platform-common-utilities/packages/pretty_logging
thomashii@dukefirehawk.com ab7c3dc952 Updated to support Dart 3
2023-05-16 00:04:04 +08:00
..
example Added pretty_logging and json_serializer 2021-09-16 11:23:05 +08:00
lib Upgraded to support sdk 2.17 2022-07-06 22:04:09 +08:00
test Upgraded to Melos 3 2023-03-26 10:15:20 +08:00
analysis_options.yaml Added pretty_logging and json_serializer 2021-09-16 11:23:05 +08:00
AUTHORS.md Upgraded to Melos 3 2023-03-26 10:15:20 +08:00
CHANGELOG.md Updated to support Dart 3 2023-05-16 00:04:04 +08:00
LICENSE Added pretty_logging and json_serializer 2021-09-16 11:23:05 +08:00
melos_belatuk_pretty_logging.iml Upgraded to support sdk 2.17 2022-07-06 22:04:09 +08:00
pubspec.yaml Updated to support Dart 3 2023-05-16 00:04:04 +08:00
README.md Migrated to Dart 3 2023-03-26 09:47:42 +08:00

Belatuk Petty Logging

Pub Version (including pre-releases) Null Safety Gitter License

Replacement of package:pretty_logging with breaking changes to support NNBD.

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

Installation

In your pubspec.yaml:

dependencies:
  belatuk_pretty_logging: ^6.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);