lumberjack 1.0.0-rc.1

  • Example
  • Installing
  • Versions
  • 48

lumberjack #

Improved hierarchical logging for Dart.

// Simple usage
var logger = Logger('example');

// Hierarchy
var baz = logger.createChild('bar').createChild('baz');

// Intercept print, errors.
logger.runZoned(() async {
    await doSomething();
}, onError: () => 34);

logger.error('...', e, st);

// Printing (with colors)

// Patch over package:logging
var converter = ConvertingLogger(oldLogger);

await for (var log in logger) {
    // ... Do something...

1.0.0-rc.1 #

  • ConvertingLogger will emit log events into the child logger as well.

1.0.0-rc.0 #


// 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();


    () async {
        ..emergency('Nooo! It\'s THREE!!!')
        ..notice('Wait, it\'s actually okay.')
        ..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...'),


  await logger.done;

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  lumberjack: ^1.0.0-rc.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:lumberjack/lumberjack.dart';
Version Uploaded Documentation Archive
1.0.0-rc.1 Dec 13, 2018 Go to the documentation of lumberjack 1.0.0-rc.1 Download lumberjack 1.0.0-rc.1 archive
1.0.0-rc.0 Dec 11, 2018 Go to the documentation of lumberjack 1.0.0-rc.0 Download lumberjack 1.0.0-rc.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:lumberjack/lumberjack.dart.

Health suggestions

Fix lib/logging.dart. (-1.49 points)

Analysis of lib/logging.dart reported 3 hints:

line 18 col 7: DO use curly braces for all flow control structures.

line 20 col 7: DO use curly braces for all flow control structures.

line 53 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix lib/io.dart. (-1 points)

Analysis of lib/io.dart reported 2 hints:

line 86 col 9: DO use curly braces for all flow control structures.

line 99 col 9: DO use curly braces for all flow control structures.

Fix lib/src/logger.dart. (-0.50 points)

Analysis of lib/src/logger.dart reported 1 hint:

line 68 col 11: DO use curly braces for all flow control structures.

Fix additional 3 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/src/string_sink.dart (1 hint)
  • lib/lumberjack.dart (Run dartfmt to format lib/lumberjack.dart.)
  • lib/src/log.dart (Run dartfmt to format lib/src/log.dart.)

Maintenance suggestions

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
intl ^0.15.7 0.15.8
io ^0.3.2 0.3.3
logging ^0.11.0 0.11.3+2
meta ^1.0.0 1.1.7
quiver_hashcode ^2.0.0 2.0.0
Transitive dependencies
charcode 1.1.2
path 1.6.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0