Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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)

ReaquiringConsoleHandler.patch (2.2 KB ) - added by floscher 6 years ago.
Avoid closing System.err stream in ReaquiringConsoleHandler. Logging messages of warning level or higher levels were prevented from displaying since r14052.

Download all attachments as: .zip

Change History (5)

by floscher, 6 years ago

Avoid closing System.err stream in ReaquiringConsoleHandler. Logging messages of warning level or higher levels were prevented from displaying since r14052.

comment:1 by Don-vip, 6 years ago

Cc: ris added
Keywords: regression added
Milestone: 18.08

comment:2 by ris, 6 years ago

Neat solution. Should have had a test for the console behaviour to catch this.

comment:3 by Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

In 14070/josm:

fix #16547 - Display log messages with log levels warn and higher in the console (patch by floscher)

comment:4 by Don-vip, 6 years ago

In 14073/josm:

see #16547 - fix PMD warning

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.