basic_logger 0.0.3 copy "basic_logger: ^0.0.3" to clipboard
basic_logger: ^0.0.3 copied to clipboard

BasicLogger is a fast, extensible, simple and lightweight logging tool for Dart and Flutter.

BasicLogger is a fast, extensible, simple and lightweight logging tool for Dart and Flutter..

Features #

It is distributed as a single file module and has no dependencies other than the Dart Standard Library.

Getting started #

  dart pub add basic_logger
  flutter pub add basic_logger

Usage #

  Logger.root.level = Level.ALL;
  final basicLogger = BasicLogger('main');

  // attach developer log
  basicLogger.attachLogger(DevOutputLogger(parentName: basicLogger.name));

  // attach console log
  basicLogger.attachLogger(ConsoleOutputLogger(parentName: basicLogger.name));

  // attach file log, bufferSize default 10
  // basicLogger.attachLogger(FileOutputLogger(parentName: basicLogger.name));

  // output to all attach instance
  basicLogger.info('hello world');
  
  // output buffer to all attach instance, not include detach instance
  basicLogger.output();

  // output
  // 2024-08-16 14:48:49.342267: [INFO] [main] hello world

Additional information #

  • FileOutputLogger, file-based logging for Android, iOS, Linux, macOS, and Windows platforms.
dart pub add basic_logger_file
flutter pub add basic_logger_file
  • FileOutputLogger, specify output file path
  basicLogger.attachLogger(FileOutputLogger(
    parentName: basicLogger.name,
    dir: './logs/',
  ));
  • FileOutputLogger, specify output buffer size
  // buffering allows you to write files multiple times instead of writing files once
  basicLogger.attachLogger(FileOutputLogger(
    parentName: basicLogger.name,
    bufferSize: 100,
  ));

  // output and clear buffer
  basicLogger.output();
0
likes
0
points
33
downloads

Publisher

verified publisheriche2.com

Weekly Downloads

BasicLogger is a fast, extensible, simple and lightweight logging tool for Dart and Flutter.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

logging, path

More

Packages that depend on basic_logger