#16547 closed defect (fixed)
[PATCH] Display log messages with log levels `warn` and higher in the console
Reported by: | floscher | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.08 |
Component: | Core | Version: | |
Keywords: | regression | Cc: | michael2402, floscher, ris |
Description
Current behaviour (since r14052)
Only log messages of exactly INFORMATION are displayed in the console, log levels WARN and ERROR are hidden.
Desired behaviour
All log messages of the current log level or higher levels are displayed
Cause
The new class ReacquiringConsoleHandler
extends ConsoleHandler
and implicitly calls the superconstructor. The superconstructor initializes the output stream with System.err
.
If ReacquiringConsoleHandler
is now instantiated with a different OutputStream
the method ConsoleHandler.setOutputStream()
will flush and close System.err
. Since log levels WARNING and higher are output to System.err
, this prevents log messages for those log levels from appearing.
Solution
Let the method ReacquiringConsoleHandler.setOutputStream()
do nothing as long as the superconstructor has not completed.
Attachments (1)
Change History (5)
by , 7 years ago
Attachment: | ReaquiringConsoleHandler.patch added |
---|
comment:1 by , 7 years ago
Cc: | added |
---|---|
Keywords: | regression added |
Milestone: | → 18.08 |
comment:2 by , 7 years ago
Neat solution. Should have had a test for the console behaviour to catch this.
Avoid closing System.err stream in ReaquiringConsoleHandler. Logging messages of warning level or higher levels were prevented from displaying since r14052.