-
Notifications
You must be signed in to change notification settings - Fork 52
Fix hierarchical logging documentation #171
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 (√√)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is incorrect. However, the output shows that the root logger fires which is actually a bug https://github.com/dart-lang/logging/issues/145 |
||
// 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 (√)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is incorrect.
|
||
// 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)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is correct, I've just updated the comment to be more clear. |
||
|
||
// Will print twice ([LOG2] & [ROOT]) because warning is sufficient for all | ||
// loggers' levels. | ||
log2.warning('LOG_02 WARNING (√√)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is correct. |
||
|
||
// Will never print because `info` is filtered by `Logger.root.level` of | ||
// `Level.WARNING`. | ||
log2.info('INFO (X)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is correct but it's not needed as it's the same case as |
||
``` | ||
|
||
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 (√√) | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is correct, I've just updated the comment to be more clear.