dart_logging 0.11.0-beta
dart_logging: ^0.11.0-beta copied to clipboard
A logging framework with structured logging, child loggers, and console output.
dart_logging #
Pino-style structured logging with child loggers.
Getting Started #
import 'package:dart_logging/dart_logging.dart';
void main() {
final context = createLoggingContext(
transports: [logTransport(logToConsole)],
);
final logger = createLoggerWithContext(context);
logger.info('Hello world');
logger.warn('Something might be wrong');
logger.error('Something went wrong');
// Child logger with inherited context
final childLogger = logger.child({'requestId': 'abc-123'});
childLogger.info('Processing request'); // requestId auto-included
}