Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emanuel-braz/dart_log
https://pub.dev/packages/dart_log - A simple dart console logger (release mode enabled/disabled and "limitless" characters)
https://github.com/emanuel-braz/dart_log
Last synced: 8 days ago
JSON representation
https://pub.dev/packages/dart_log - A simple dart console logger (release mode enabled/disabled and "limitless" characters)
- Host: GitHub
- URL: https://github.com/emanuel-braz/dart_log
- Owner: emanuel-braz
- License: bsd-3-clause
- Created: 2022-01-30T03:23:55.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-26T02:33:44.000Z (over 2 years ago)
- Last Synced: 2023-08-20T21:43:41.166Z (about 1 year ago)
- Language: Dart
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
### A simple dart console logger (release mode enabled/disabled and "limitless" characters)
### Usage
```dart
logger.d('message');
logger.e('message');
logger.i('message');
logger.w('message');
logger.trace('message');
logger.prod('message');
``````dart
final tagLogger = logger.withTag('MY_TAG');
tagLogger.d('message'); // [MY_TAG]: message
``````dart
logger.d('{"id": 123}', isJson: true);
/*
{
"id": 123
}
*/
``````dart
// Log in release mode
logger.prod('message');
```#### All logs enabled in release mode (using dart-define)
```bash
flutter build apk --release --dart-define dart_log_verbose="true"
```#### Print max to "N" chars (useful with long api responses)
```dart
logger.d('long response from API', maxChars: 10000);
```#### `fileLinkLevel`: use this to get the link of the file that dispatched the log
```dart
// default = 3
logger.d('Link to file', fileLinkLevel: 3);
```#### Interceptors
Use the `DefaultLogInterceptor` or implement a custom `LogInterceptor````dart
Logger.interceptors.add(DefaultLogInterceptor((Object? data) {
print('ERROR: $data');
}, logTypes: [LogType.error]));
```