Provides simple APIs for logging & managing logs. Uses the logger from pub.dev:logging.
If using flutter, import pub.dev:logging_manager_flutter instead.
LoggingTreeis attached as a listener to logs sent from logger by the
LoggingManager. Implementations are: PrintingColoredLogsTree, PrintingLogsTree, FormattedOutputLogsTree.
LoggingManagercan be used to create a logger, listen to logs, change
Start by importing this package in your project using
dart pub add logging_manager
flutter pub add logging_manager
pub add logging_manager
- Import this package in file.
- Create a LoggingManager. Note: A LoggingTree is responsible for doing something with logs. If none provided, nothing will happen.
final logginManager = LoggingManager( tree: PrintingColoredLogsTree(), );
package:logging's logger. The
Loggingpackage's logger factory constructor returns a singleton instance from a matching
name. The logger used in the above package also had
''as its name.
final logger = Logger('');
- Use it to log anything.
- To catch errors from the
Zone, you can use
- To catch errors that happen outside of the main Isolate's context, install an error listener on the current Isolate with
- Please check the example for more usage information.
- For more information about using the logger, check pub.dev:logging.