bonsai 1.0.0+1 copy "bonsai: ^1.0.0+1" to clipboard
bonsai: ^1.0.0+1 copied to clipboard

outdated

A tiny Dart logging package using dart:developer logging, API inspired by Android logging.

example/bonsai_example.dart

import 'package:bonsai/bonsai.dart';

void main() {
  const debug = true;
  if (debug) {
    // pass true to enable output to stderr
    Log.init(true);
  }
  final myObj = MyClass();
  myObj.doSomething();

  Log.d('Main', 'custom tags are also available');

  // there is also a specific method for errors:
  try {
    throw FormatException('something went very wrong');
  } catch (e, st) {
    Log.e('some error happened', e, st);
  }
}

class MyClass {
  void doSomething() {
    log("hello I'm doing something");
  }
}
10
likes
0
pub points
46%
popularity

Publisher

verified publishermanichord.com

A tiny Dart logging package using dart:developer logging, API inspired by Android logging.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

logging

More

Packages that depend on bonsai