logger 0.2.0

  • README.md
  • Installing
  • Versions
  • 76


A simple, yet efficient structured logger for Dart.


$ pub get logger

Package uses brand new features from Dart 2.0 which is currently in public beta, in order to use this package make sure that you add --preview-dart-2 to flags when running on Dart VM

Quick Start

import 'package:logger/logger.dart' show Logger, Tracer;
import 'package:logger/handlers.dart' show CliHandler;

final logger = Logger('example')..addHandler(CliHandler());

void main() {
  final Tracer tracer = logger.withFields({
    'env': 'development',
    'port': 3000
  }).trace('App starts...');
  // stuff...
  tracer.stop('App started!');

Find out detailed APIs by the following link.


The source is released under the terms of MIT license.



  • Initial release

Use this package as a library

1. Depend on it

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

  logger: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:logger/logger.dart';
Version Uploaded Documentation Archive
0.2.0 Jul 6, 2018 Go to the documentation of logger 0.2.0 Download logger 0.2.0 archive
0.1.0 Jan 29, 2018 Go to the documentation of logger 0.1.0 Download logger 0.1.0 archive
0.1.0-alpha.1 Jan 22, 2018 Go to the documentation of logger 0.1.0-alpha.1 Download logger 0.1.0-alpha.1 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 Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4


Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/src/formatters/text_formatter.dart. (-0.50 points)

Analysis of lib/src/formatters/text_formatter.dart reported 1 hint:

line 6 col 17: The top level variable '_' isn't used.

Fix lib/src/handlers/cli_handler.dart. (-0.50 points)

Analysis of lib/src/handlers/cli_handler.dart reported 1 hint:

line 5 col 18: The top level variable '_' isn't used.

Fix lib/src/handlers/memory_handler.dart. (-0.50 points)

Analysis of lib/src/handlers/memory_handler.dart reported 1 hint:

line 4 col 18: The top level variable '_' isn't used.

Format lib/logger.dart.

Run dartfmt to format lib/logger.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use logger.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >2.0.0-dev <=3.0.0