Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

angel-dart-archive/pretty_logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pretty_logging

Pub

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

Releases

No releases published

Packages

No packages published

Languages