logo separator

[mkgmap-dev] diagnostic patch

From Mike Baggaley mike at tvage.co.uk on Fri Apr 9 23:57:18 BST 2021

Hi Gerd, 

The primary reason for this part of the change is to make sure that if you
specify a diagnostic option then you get any messages about it included in
your output. Currently the only way to see any of these messages is if you
use a log.config file to enable a lower level of logging. In one case you
have to go as low as info which causes your wanted messages to be buried in
a lot of other messages that you don't necessarily want. The new levels are
higher than ERROR, so will be output providing the log level is set to ERROR
or lower. Using separate levels also makes it easy to filter the output
should you want to do so, so anything at DIAGNOSTIC level will be a message
from  a requested diagnostic option. In the logging config file you can
choose whether you want the level to be included in the message - I don't
include it and I see yours truncates it to 4 characters.

In the log.config file, if you specify a .level= of 1100, you will get just
DIAGNOSTIC, ECHO and OVERRIDE messages (i.e. no error messages), 1200 will
give you just ECHO and OVERRIDE, 1300 just OVERRIDE. You could therefore set
java.util.logging.ConsoleHandler.level=1300, so it will more or less just
output the version number, start and finish times, total time taken and
number of exceptions (once the rest of the changes are added). Having these
3 levels offers more flexibility than lumping them all together at a single
level.

The ConsoleHandler writes all its output to stderr and we have no control
over that. These messages are currently also output to stderr (if you use a
logging.config file to enable the level required to see them).

If I use the logging.config file you sent me, I can see the messages in both
the console and the log file. Have you got ConsoleHandler enabled as a
handler in the config file you are using?

Cheers,
Mike

-----Original Message-----
From: Gerd Petermann [mailto:gpetermann_muenchen at hotmail.com] 
Sent: 09 April 2021 07:48
To: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Subject: Re: [mkgmap-dev] diagnostic patch

Hi Mike,

reg. diagnostics.patch:

Please help me with the commit message. What changes are implemented?
What changes in output to logging files or console are intended?
Are the new levels meant to be used by the user in the logging.properties
file? If yes, how exactly?

Without logging.properties I see the diagnostics messages like "Roundabout
1374016 direction is wrong - .." written to stderr now. Why not stdout?
If I use -Dlog.config=logging.properties the diagnostic messages are not
written to the console. Is that intended?

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Mike
Baggaley <mike at tvage.co.uk>
Gesendet: Mittwoch, 7. April 2021 11:00
An: 'Development list for mkgmap'
Betreff: [mkgmap-dev] diagnostic patch

Hi Gerd,

Please find attached two patches - one that contains the user interface and
logging changes to provide improved output from the diagnostic options,
along with the other logging interface changes in readiness for replacing
direct writes to stdout/err. The second documents the steps that may be
taken to work around code page problems.

Cheers,
Mike




More information about the mkgmap-dev mailing list