Modify

Opened 7 weeks ago

Closed 7 weeks ago

Last modified 7 weeks 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 7 weeks 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)

Changed 7 weeks ago by floscher

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

comment:1 Changed 7 weeks ago by Don-vip

Cc: ris added
Keywords: regression added
Milestone: 18.08

comment:2 Changed 7 weeks ago by ris

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

comment:3 Changed 7 weeks ago by Don-vip

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 Changed 7 weeks ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.