logging_manager_flutter 1.0.0
logging_manager_flutter: ^1.0.0 copied to clipboard
Provides simple APIs for logging & managing logs. Logging manager with flutter support.
Logging Manager for Flutter Projects #
Provides simple APIs for logging & managing logs. Logging manager with flutter support.
Features #
- Provides
FlutterLoggingManageras a replacement for LoggingManager for flutter projects. FlutterLoggingManagerhasonFlutterErrormethod which can be capture flutter error.
FlutterError.onError = loggingManager.onFlutterError;
Get Started - Dependency setup #
Either add dependency in pubspec.yaml file
logging_manager_flutter: ^1.0.0
Or add dependency with
flutter pub add logging_manager_flutter
Usage #
- Import this package in file.
import 'package:logging_manager_flutter/logging_manager_flutter.dart';
- Create a FlutterLoggingManager. Note: A LoggingTree is responsible for doing something with logs. If none provided, nothing will happen.
final loggingManager = FlutterLoggingManager(
tree: PrintingColoredLogsTree(),
);
- Optionally add flutter logging manager to record flutter errors.
FlutterError.onError = loggingManager.onFlutterError;
- Get
package:logging's logger from above manager.
final appLogger = loggingManager.logger;
- Use logger to log anything.
appLogger.info('Hello World');
Additional Information #
For more usage see Logging Manager package.