
Hi Gerd, Please find attached a patch with the remainder of the logging changes (apart from CommandArgs). There are changes to the main program so that the dates and times are only output if mkgmap is processing one or more files. The patch includes an update to the unit test. Note that this now takes a little longer to run, because of having to create new processes to run some of the tests. BTW, were you expecting a change to diagnosticmessages.patch, or is it OK as it stands? (I've attached a copy in case it got lost amongst all the others.) Cheers, Mike

Hi Mike, reg. diagnosticmessages.patch: My understanding of the text is that you get rid of the console messages if you use a logging configuration file. When I try this with my existing config file I don't see this effect because the configuration tells the logger to also write those messages to the console. A similar config can be found in the wiki https://wiki.openstreetmap.org/wiki/Mkgmap/dev#Enabling_Debugging So, what I am missing is the hint that the config file should NOT contain a console handler. Writing this I wonder if it is now impossible to see only error messages on stderr when the reporting options are enabled? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike@tvage.co.uk> Gesendet: Montag, 12. April 2021 17:56 An: 'Development list for mkgmap' Betreff: [mkgmap-dev] remainder of logging changes Hi Gerd, Please find attached a patch with the remainder of the logging changes (apart from CommandArgs). There are changes to the main program so that the dates and times are only output if mkgmap is processing one or more files. The patch includes an update to the unit test. Note that this now takes a little longer to run, because of having to create new processes to run some of the tests. BTW, were you expecting a change to diagnosticmessages.patch, or is it OK as it stands? (I've attached a copy in case it got lost amongst all the others.) Cheers, Mike

Hi Steve, please comment what you think about the trick with TestUtils.runAsProcess(). I think it might not work on the build server since ant clean test doesn't build \dist\mkgmap.jar. Of course we can add target dist as a depency in build.xml to fix that, but I think you had reasons to avoid that? Do you think this is the right way to go? Doesn't it somehow bypass the junit stuff? Would it help to move to JUnit 5? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Dienstag, 13. April 2021 08:52 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] remainder of logging changes Hi Mike, reg. diagnosticmessages.patch: My understanding of the text is that you get rid of the console messages if you use a logging configuration file. When I try this with my existing config file I don't see this effect because the configuration tells the logger to also write those messages to the console. A similar config can be found in the wiki https://wiki.openstreetmap.org/wiki/Mkgmap/dev#Enabling_Debugging So, what I am missing is the hint that the config file should NOT contain a console handler. Writing this I wonder if it is now impossible to see only error messages on stderr when the reporting options are enabled? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike@tvage.co.uk> Gesendet: Montag, 12. April 2021 17:56 An: 'Development list for mkgmap' Betreff: [mkgmap-dev] remainder of logging changes Hi Gerd, Please find attached a patch with the remainder of the logging changes (apart from CommandArgs). There are changes to the main program so that the dates and times are only output if mkgmap is processing one or more files. The patch includes an update to the unit test. Note that this now takes a little longer to run, because of having to create new processes to run some of the tests. BTW, were you expecting a change to diagnosticmessages.patch, or is it OK as it stands? (I've attached a copy in case it got lost amongst all the others.) Cheers, Mike _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd
please comment what you think about the trick with TestUtils.runAsProcess(). I think it might not work on the build server since ant clean test doesn't build \dist\mkgmap.jar. Of course we can add target dist as a depency in build.xml to fix that, but I think you had reasons to avoid that?
It doesn't work in Linux for the reasons you mentioned. You can probably just use "java" and it will work for both? (I can't test on Windows at the moment). The backslash doesn't work on Linux, but I believe that forward slash will work on both. If not, then you can use File.separator. I probably didn't build dist just because there was no need to, its no big deal to add it, but you can avoid doing so by using -classpath instead of -jar if you wish. The following that works on Linux and I believe it would work on windows too: List<String> args = new ArrayList<>(Arrays.asList( "java", "-classpath", "build/classes" + File.pathSeparator + "lib/compile/*", "uk.me.parabola.mkgmap.main.Main", Args.TEST_STYLE_ARG )); args.addAll(Arrays.asList(in));
Do you think this is the right way to go? Doesn't it somehow bypass the junit stuff? Would it help to move to JUnit 5?
I do not see anything wrong with doing it that way as long as it works in all environments. Steve

Hi Steve, please have a look. Seems the build hangs again or the patch doesn't work on unix. It works well on my machine. Gerd ________________________________________ Von: Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Dienstag, 13. April 2021 12:23 An: Gerd Petermann; Development list for mkgmap; Steve Ratcliffe Betreff: Re: AW: [mkgmap-dev] remainder of logging changes Hi Gerd
please comment what you think about the trick with TestUtils.runAsProcess(). I think it might not work on the build server since ant clean test doesn't build \dist\mkgmap.jar. Of course we can add target dist as a depency in build.xml to fix that, but I think you had reasons to avoid that?
It doesn't work in Linux for the reasons you mentioned. You can probably just use "java" and it will work for both? (I can't test on Windows at the moment). The backslash doesn't work on Linux, but I believe that forward slash will work on both. If not, then you can use File.separator. I probably didn't build dist just because there was no need to, its no big deal to add it, but you can avoid doing so by using -classpath instead of -jar if you wish. The following that works on Linux and I believe it would work on windows too: List<String> args = new ArrayList<>(Arrays.asList( "java", "-classpath", "build/classes" + File.pathSeparator + "lib/compile/*", "uk.me.parabola.mkgmap.main.Main", Args.TEST_STYLE_ARG )); args.addAll(Arrays.asList(in));
Do you think this is the right way to go? Doesn't it somehow bypass the junit stuff? Would it help to move to JUnit 5?
I do not see anything wrong with doing it that way as long as it works in all environments. Steve

Hi Gerd
please have a look. Seems the build hangs again or the patch doesn't work on unix. It works well on my machine.
What is happening is that the automatic builds set _JAVA_OPTIONS=-Duser.home=/home/dir/to/use This causes every java process to output "Picked up _JAVA_OPTIONS: ..." to stderr. So the tests that check for no stderr fail. I can only suggest filtering out that line as in the attached patch. Steve

Hi Steve , OK for me if you add a comment reg. the automatic build Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Dienstag, 13. April 2021 19:10 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] remainder of logging changes Hi Gerd
please have a look. Seems the build hangs again or the patch doesn't work on unix. It works well on my machine.
What is happening is that the automatic builds set _JAVA_OPTIONS=-Duser.home=/home/dir/to/use This causes every java process to output "Picked up _JAVA_OPTIONS: ..." to stderr. So the tests that check for no stderr fail. I can only suggest filtering out that line as in the attached patch. Steve

Hi Gerd, I don't think the text implies that you get rid of console messages if you use a logging config file. I think the best place for any additional information about setting up a logging file is logging.txt (which I now notice incorrectly mentions stdout instead of stderr). It would probably also be useful if logging.txt included a complete list of the available loggers, as currently you need to read the source to find out what they are. With the update you can't display error messages in stderr, with all other messages going to the log file. If that is something you think important then I think the way forward is to change the DIAGNOSTIC and ECHO LogLevel values to between WARNING and ERROR, rather than being above ERROR. Unfortunately the logging mechanism doesn't allow a range of log levels to be reported, only allowing filtering out those below a specified level. So with the current levels you can output DIAGNOSTIC and ECHO messages to sdterr and filter out other messages, but not vice-versa. Where would you prefer the DIAGNOSTIC and ECHO levels to sit? Cheers, Mike -----Original Message----- From: Gerd Petermann [mailto:gpetermann_muenchen@hotmail.com] Sent: 13 April 2021 07:52 To: Development list for mkgmap <mkgmap-dev@lists.mkgmap.org.uk> Subject: Re: [mkgmap-dev] remainder of logging changes Hi Mike, reg. diagnosticmessages.patch: My understanding of the text is that you get rid of the console messages if you use a logging configuration file. When I try this with my existing config file I don't see this effect because the configuration tells the logger to also write those messages to the console. A similar config can be found in the wiki https://wiki.openstreetmap.org/wiki/Mkgmap/dev#Enabling_Debugging So, what I am missing is the hint that the config file should NOT contain a console handler. Writing this I wonder if it is now impossible to see only error messages on stderr when the reporting options are enabled? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike@tvage.co.uk> Gesendet: Montag, 12. April 2021 17:56 An: 'Development list for mkgmap' Betreff: [mkgmap-dev] remainder of logging changes Hi Gerd, Please find attached a patch with the remainder of the logging changes (apart from CommandArgs). There are changes to the main program so that the dates and times are only output if mkgmap is processing one or more files. The patch includes an update to the unit test. Note that this now takes a little longer to run, because of having to create new processes to run some of the tests. BTW, were you expecting a change to diagnosticmessages.patch, or is it OK as it stands? (I've attached a copy in case it got lost amongst all the others.) Cheers, Mike

Hi all, forgot to mention that "java.exe" probably doesn't exist on a unix based system, and also the path "dist\\mkgmap.jar" probably will not work. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike@tvage.co.uk> Gesendet: Montag, 12. April 2021 17:56 An: 'Development list for mkgmap' Betreff: [mkgmap-dev] remainder of logging changes Hi Gerd, Please find attached a patch with the remainder of the logging changes (apart from CommandArgs). There are changes to the main program so that the dates and times are only output if mkgmap is processing one or more files. The patch includes an update to the unit test. Note that this now takes a little longer to run, because of having to create new processes to run some of the tests. BTW, were you expecting a change to diagnosticmessages.patch, or is it OK as it stands? (I've attached a copy in case it got lost amongst all the others.) Cheers, Mike

Java generally can be installed readily in Linux. Here is a Ubuntu example: $ java Command 'java' not found, but can be installed with: sudo apt install default-jre sudo apt install openjdk-11-jre-headless sudo apt install openjdk-8-jre-headless Randolph J. Herber On 13-Apr-21 04:35, Gerd Petermann wrote:
Hi all,
forgot to mention that "java.exe" probably doesn't exist on a unix based system, and also the path "dist\\mkgmap.jar" probably will not work.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike@tvage.co.uk> Gesendet: Montag, 12. April 2021 17:56 An: 'Development list for mkgmap' Betreff: [mkgmap-dev] remainder of logging changes
Hi Gerd,
Please find attached a patch with the remainder of the logging changes (apart from CommandArgs).
There are changes to the main program so that the dates and times are only output if mkgmap is processing one or more files.
The patch includes an update to the unit test. Note that this now takes a little longer to run, because of having to create new processes to run some of the tests.
BTW, were you expecting a change to diagnosticmessages.patch, or is it OK as it stands? (I've attached a copy in case it got lost amongst all the others.)
Cheers, Mike _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (4)
-
Gerd Petermann
-
Mike Baggaley
-
Randolph J. Herber
-
Steve Ratcliffe