logging_colorful 1.2.1 copy "logging_colorful: ^1.2.1" to clipboard
logging_colorful: ^1.2.1 copied to clipboard

Logging package with colors, no external dependencies.

example/logging_colorful_example.dart

import 'dart:io';

import 'package:logging_colorful/logging_colorful.dart';

void main() {
  // Define your Logger configuration
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((record) {
    print('${record.loggerName} - ${record.level.name}: ${record.message}');
  });

  // Initialize a LoggerColorful that will make your logger colorized
  // You can disable colors
  // May be useful for iOS users, since iOS doesn't render ANSI Colors (escaped)
  final log = LoggerColorful('MyLogger', disabledColors: Platform.isIOS);
  log.shout('shout');
  log.severe('severe');
  log.warning('warning');
  log.info('info');
  log.config('config');
  log.fine('fine');
  log.finer('finer');
  log.finest('finest');

  // Change the Color for a Level
  log.colorLevel[Level.FINEST] = AnsiColor.rainbow;
  log.finest('finest with rainbow of color');
}
1
likes
130
pub points
39%
popularity

Publisher

verified publisherethicnology.com

Logging package with colors, no external dependencies.

Repository (GitHub)
View/report issues

Documentation

API reference

License

LGPL-3.0 (LICENSE)

Dependencies

logging

More

Packages that depend on logging_colorful