https://github.com/wim07101993/fox_logging
A dart package containing some helpful extensions for the standard logging package. It provides a flow to make logging more structured by introducing sinks and formatters.
https://github.com/wim07101993/fox_logging
dart flutter logging
Last synced: 5 months ago
JSON representation
A dart package containing some helpful extensions for the standard logging package. It provides a flow to make logging more structured by introducing sinks and formatters.
- Host: GitHub
- URL: https://github.com/wim07101993/fox_logging
- Owner: wim07101993
- License: mit
- Created: 2021-12-05T16:08:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-27T15:10:52.000Z (over 1 year ago)
- Last Synced: 2025-07-27T21:01:01.407Z (11 months ago)
- Topics: dart, flutter, logging
- Language: Dart
- Homepage:
- Size: 499 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
# Fox Logging
[](https://codecov.io/gh/wim07101993/fox_logging)
[](https://github.com/wim07101993/fox_logging/actions/workflows/ensure_code_quality.yml)
[](https://opensource.org/licenses/MIT)
A package containing some helpful extensions for the standard logging package.
It provides a flow to make logging more structured by introducing sinks and
formatters.
## Sink
A sink write a log entry to some place, like the console, file, database,...
```dart
final sink = IoLogSink(myFormatter);
```
## Formatter
Formatters format a `LogRecord` to a `String` in a certain way. This can be a
pretty, verbose or simple, concise log. Or a complete custom implementation.
```dart
final simpleFormatter = SimpleFormatter();
```
## Small example
```dart
final logger = Logger('Simple');
final sink = IoLogSink(SimpleFormatter())
..listenTo(logger.onRecord);
```
Images below show the `SimpleFormatter` and `PrettyFormatter` when using the `PrintSink`.
`SimpleFormatter`:

`PrettyFormatter`:

For a more detailed example check out the [example](https://github.com/wim07101993/fox_logging/tree/master/example).