emodebug 0.3.0 copy "emodebug: ^0.3.0" to clipboard
emodebug: ^0.3.0 copied to clipboard

outdated

Emoji based semantic debuging. Debug the state and execution flow of a program with familiar idioms

example/lib/main.dart

import 'package:emodebug/emodebug.dart';

/// The normal [EmoDebug] class initialization
//const EmoDebug debug = EmoDebug();

/// The custom implementation
const CustomEmoDebug debug = CustomEmoDebug();

/// A class that extends [EmoDebug] with custom methods
class CustomEmoDebug extends EmoDebug {
  /// The base constructor
  const CustomEmoDebug();

  /// The crash method to indicate a program failure
  void crash(dynamic obj, [String domain]) => emo("💥", obj, domain);

  /// The recovery method to indicate a program recovery
  void recovery(dynamic obj, [String domain]) => emo("👍", obj, domain);
}

void main() {
  _printLines(1);
  debug.init("Initializing");
  _printLines(3);
  debug.ok("Everything is ok");
  _printLines(2);
  debug.state("A state operation");
  _printLines(1);
  debug.save("Saving something");
  _printLines(2);
  debug.delete("Deleting something");
  _printLines(3);
  debug.update("Updating something");
  _printLines(2);
  _printLines(1);
  final data = {"foo": "bar"};
  debug.data(data, "some data");
  _printLines(2);
  debug.crash("A crash occured!!!");
  _printLines(4);
  debug.recovery("Recovery successful");
  _printLines(3);
  debug.emo("🏁", "Finish");
}

var _i = 1;

void _printLines(int n) {
  var i = 0;
  while (i < n) {
    print("[$_i] Normal debug message flow message");
    ++i;
    ++_i;
  }
}
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Emoji based semantic debuging. Debug the state and execution flow of a program with familiar idioms

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

extra_pedantic, pedantic

More

Packages that depend on emodebug