Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vaetas/logx
Simple and concise logs for Dart/Flutter
https://github.com/vaetas/logx
dart flutter
Last synced: 3 days ago
JSON representation
Simple and concise logs for Dart/Flutter
- Host: GitHub
- URL: https://github.com/vaetas/logx
- Owner: vaetas
- License: bsd-3-clause
- Created: 2020-07-27T19:32:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-08T14:32:35.000Z (about 3 years ago)
- Last Synced: 2024-12-18T09:45:23.785Z (18 days ago)
- Topics: dart, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/logx
- Size: 80.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# LogX: Simple and concise logs for Flutter
![Pub Version](https://img.shields.io/pub/v/logx)
LogX adds extends method `log` from `dart:developer` package to add useful features, namely mixins and static methods.
![Screenshot](screenshot.png)
## Mixin
You can use `LogMixin` to easily include log methods into any class. With mixin name of the context is automatically set to runtime type of current class.
```dart
class A with LogMixin {
void hello() {
log.d('Hello world!');
log('This instance is callable!');
}
}
```You can either use methods: `log.d('Hello')` or call the class instance: `log('Hello')`. Both results to equal output.
## Static methods
If you cannot use `LogMixin` (for example in top-level functions) you can use static methods from `Log` class. Remeber that you need to provide name by yourself, otherwise default name is used.
```dart
void main() {
Log.d('Hello', name: 'Main');
}
```***
**Important:** Do not import `dart:developer` together with this package. They both use `log` keyword and it might conflict.