logger 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 81

Logger

A simple, yet efficient structured logger for Dart.

Installation

$ 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.

License

The source is released under the terms of MIT license.

CHANGELOG.md

0.1.0

  • Initial release

Use this package as a library

1. Depend on it

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


dependencies:
  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
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

The description is too short.

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

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Format lib/logger.dart.

Run dartfmt to format lib/logger.dart.

Fix lib/src/formatters/text_formatter.dart.

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.

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.

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

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

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.

Dependencies

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