dart_log 1.2.0 copy "dart_log: ^1.2.0" to clipboard
dart_log: ^1.2.0 copied to clipboard

A simple dart console logger (release mode enabled/disabled and "limitless" characters)

A simple dart console logger (release mode enabled/disabled and "limitless" characters) #

Usage #

logger.d('message');
logger.e('message');
logger.i('message');
logger.w('message');
logger.trace('message');
logger.prod('message');
final tagLogger = logger.withTag('MY_TAG');
tagLogger.d('message'); // [MY_TAG]: message
logger.d('{"id": 123}', isJson: true); 
/*
    {
        "id": 123 
    }
*/
// Log in release mode
logger.prod('message');

All logs enabled in release mode (using dart-define)

flutter build apk --release --dart-define dart_log_verbose="true"
logger.d('long response from API', maxChars: 10000);
// default = 3
logger.d('Link to file', fileLinkLevel: 3);

Interceptors

Use the DefaultLogInterceptor or implement a custom LogInterceptor

Logger.interceptors.add(DefaultLogInterceptor((Object? data) {
    print('ERROR: $data');
}, logTypes: [LogType.error]));
2
likes
160
points
444
downloads

Publisher

unverified uploader

Weekly Downloads

A simple dart console logger (release mode enabled/disabled and "limitless" characters)

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on dart_log