bonsai 1.2.0 copy "bonsai: ^1.2.0" to clipboard
bonsai: ^1.2.0 copied to clipboard

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
150
pub points
45%
popularity

Publisher

verified publishermanichord.com

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

logging

More

Packages that depend on bonsai