lumberjack 1.0.0-rc.1

Dart native js
Flutter Android iOS web

Hierarchical logging for Dart. Supports multiple transports, zones, and more.

example/main.dart

// ignore_for_file: unawaited_futures
import 'package:lumberjack/lumberjack.dart';
import 'package:lumberjack/io.dart';

main() async {
  var logger = new Logger('example');
  var foo = logger.createChild('foo');

  var printer = new AnsiLogPrinter.toStdout();

  printer.addStream(logger);

  foo.runZoned(
    () async {
      Logger.current
        ..emergency('Nooo! It\'s THREE!!!')
        ..notice('Wait, it\'s actually okay.')
        ..debug('Ok...')
        ..warning('Don\'t do that!!! At least, not yet...');

      print('Calls to print are captured, too!');

      throw new StateError('Errors are logged, too.');
    },
    onError: () => print('caught error...'),
  );

  foo.createChild('bar').createChild('baz').notice('Hooray!');

  await logger.done;
}
0
likes
90
pub points
0%
popularity

Hierarchical logging for Dart. Supports multiple transports, zones, and more.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

thosakwe@gmail.com

License

MIT (LICENSE)

Dependencies

intl, io, logging, meta, quiver_hashcode

More

Packages that depend on lumberjack