Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Fix hierarchical logging documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedLSayed9 committed Jul 30, 2024
1 parent 8752902 commit 4ffa152
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,34 +108,30 @@ their `onRecord` streams.
});
// Will NOT print because FINER is too low level for `Logger.root`.
// Will NOT print because FINER is too low level for ([LOG1] & [ROOT]).
log1.finer('LOG_01 FINER (X)');
// Will print twice ([LOG1] & [ROOT])
log1.fine('LOG_01 FINE (√)');
// Will print ONCE by [LOG1] because FINE is too low level for [ROOT].
log1.fine('LOG_01 FINE (√)');
// Will print ONCE because `log1` only uses root listener.
log1.warning('LOG_01 WARNING (√)');
// Will print twice ([LOG1] & [ROOT]) because warning is sufficient for all
// loggers' levels.
log1.warning('LOG_01 WARNING (√√)');
// Will never print because FINE is too low level.
// Will NOT print because FINE is too low level for ([LOG1] & [ROOT]).
log2.fine('LOG_02 FINE (X)');
// Will print twice ([LOG2] & [ROOT]) because warning is sufficient for all
// loggers' levels.
log2.warning('LOG_02 WARNING (√√)');
// Will never print because `info` is filtered by `Logger.root.level` of
// `Level.WARNING`.
log2.info('INFO (X)');
```

Results in:

```
[LOG1][FINE+] LOG_01 FINE (√√)
[ROOT][WARNING+] LOG_01 FINE (√√)
[LOG1][FINE+] LOG_01 WARNING (√)
[ROOT][WARNING+] LOG_01 WARNING (√)
[LOG1][FINE+] LOG_01 FINE (√)
[LOG1][FINE+] LOG_01 WARNING (√√)
[ROOT][WARNING+] LOG_01 WARNING (√√)
[LOG2][WARNING+] LOG_02 WARNING (√√)
[ROOT][WARNING+] LOG_02 WARNING (√√)
```
Expand Down

0 comments on commit 4ffa152

Please sign in to comment.