logo separator

[mkgmap-dev] diagnostic patch

From Mike Baggaley mike at tvage.co.uk on Sat Apr 10 12:42:29 BST 2021

Hi Gerd,

I suggest a couple of minor tweaks to the commit message:

diagnostics.patch by Mike Baggaley
- diagnostic messages are now written to stderr when there is no logging
configuration specified.
- diagnostic messages have the level DIAGNOSTIC when they are logged. Before
some had WARNING, some had INFO.
- deprecate option --check-routing-island-len, replaced by new options
--report-routing-islands and --max-routing-island-len
- change documentation for options --report-similar-arcs and
--report-dead-ends

A good idea to add a note about diagnostic reporting to stderr in the
documentation. Please see the attached patch.

I agree that stderr is better than standard error, as it is the usually used
term.

Cheers,
Miike

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

Hi Mike,

it seems I sometimes "tested" your patch with the binary in the faster-mp
branch, so of course I got confused about the results. Sorry for that.

Reg. reporting to stderr: Maybe this could be documented similar to the
--version option in a further step?
Also confusing: We use the word stderr for version, but "standard error" in
the style docs. I think stderr is much better.

I plan to commit the patch with the attached commit message. Please suggest
improvements if I missed something important.

Gerd


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

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


_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diagnosticmessages.patch
Type: application/octet-stream
Size: 580 bytes
Desc: not available
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20210410/6b3fda32/attachment.obj>


More information about the mkgmap-dev mailing list