The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2019-08-09 18:53:32 -04:00
example 1.0.0 2019-08-09 18:53:32 -04:00
lib 1.0.0 2019-08-09 18:53:32 -04:00
.gitignore Initial commit 2019-08-09 18:39:53 -04:00
analysis_options.yaml 1.0.0 2019-08-09 18:53:32 -04:00
CHANGELOG.md 1.0.0 2019-08-09 18:53:32 -04:00
LICENSE Initial commit 2019-08-09 18:39:53 -04:00
pubspec.yaml 1.0.0 2019-08-09 18:53:32 -04:00
README.md 1.0.0 2019-08-09 18:53:32 -04:00

pretty_logging

Standalone helper for colorful logging output, using pkg:io AnsiCode.

Installation

In your pubspec.yaml:

dependencies:
  pretty_logging: 1.0.0

Usage

Basic usage is very simple:

myLogger.onRecord.listen(prettyLog);

However, you can conditionally pass logic to omit printing an error, provide colors, or to provide a custom print function:

var pretty = prettyLog(
  logColorChooser: (_) => red,
  printFunction: stderr.writeln,
  omitError: (r) {
    var err = r.error;
    return err is AngelHttpException && err.statusCode != 500;
  },
);
myLogger.onRecord.listen(pretty);