log_service 1.0.0-dev.4 copy "log_service: ^1.0.0-dev.4" to clipboard
log_service: ^1.0.0-dev.4 copied to clipboard

A Dart package for simplify the usage of the official `logging` package.

log_service #

A Dart package for simplify the usage of the official logging package.

Features #

  • LogController: An interface for controlling the logger instance.
  • LogService: A mixin provides logging#Logger's methods and implements the LogController interface, which can be mixed into any class.

Getting started #

Add log_service as a dependency in your pubspec.yaml file.

dependencies:
  log_service: ^<latest-version>

Usage #

1. Log Levels #

The log level is folling the logging's strategy, the logLevel is inheirted from the Logger.root instance and can only be changed through the Logger.root instance by default.

Sets hierarchicalLoggingEnabled = true to enable hierarchical logging, then use the logLevel of the LogController interface to set log level for each LogSerivice.

2. Log Events #

Listen the Logger.root.onRecord stream to get log events.

3. Log Methods #

  • logger.shout();
  • logger.severe();
  • logger.warning();
  • logger.info();
  • logger.config();
  • logger.fine();
  • logger.finer();
  • logger.finest();

Additional information #

Get more tips form the logging framework.

0
likes
0
pub points
49%
popularity

Publisher

verified publisheryanshouwang.dev

A Dart package for simplify the usage of the official `logging` package.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

logging, meta

More

Packages that depend on log_service