openlcb / OpenLCB_Java

Java implementation of OpenLCB / LCC protocols. This implementation operates inside JMRI, and can also be used inside Android apps.
6 stars 9 forks source link

Use logging instead of dumping to STDERR or STDOUT #79

Closed rhwood closed 7 years ago

rhwood commented 7 years ago

Use a java.util.logging.Logger in place of most uses of ``System.(err|out).println``` in the sources (but not in the tests) so that consuming applications (mostly JMRI) can manage logging. See JMRI/JMRI#3063

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 66.629% when pulling d689988cef9674a7cca224acd7dc0e9c014770d1 on rhwood:logging into 8f21ebf8258c18e75634dc500e82a79a82b9398c on openlcb:master.

rhwood commented 7 years ago

In this case, I think the percent covered decreased only because the amount of coverable code decreased.

pabender commented 7 years ago

What I find interesting is that the coveralls check appears, but the Travis one isn't, and it should be. We know it ran, because that is how the coveralls check was triggered.

I'm going to close and re-open to see if that appears.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 66.629% when pulling d689988cef9674a7cca224acd7dc0e9c014770d1 on rhwood:logging into 8f21ebf8258c18e75634dc500e82a79a82b9398c on openlcb:master.

rhwood commented 7 years ago

@pabender Thanks; I hadn't clued into that.

pabender commented 7 years ago

Ok, tests area appearing now. This is the first real commit since the test coverage was instituted. I'm going to commit this, and hen I need to adjust the threshholds for failure on coveralls.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 66.629% when pulling 5d916dec78e9dd97f81c8cdcc63538ac08019f8c on rhwood:logging into 8f21ebf8258c18e75634dc500e82a79a82b9398c on openlcb:master.

pabender commented 7 years ago

@rhwood, you snuck another change in here.

I want to get this committed before @balazsracz fixes the commit history, which is going to force us to rebase our local repositories.

rhwood commented 7 years ago

@pabender Go ahead and merge. I put a change that the first Travis CI build caught. Nothing more to add.

balazsracz commented 7 years ago

To the original topic of this commit: after we do logging, will the errors appear on the JMRI console?

As for the rebase: I'm ready with the script; I can do whenever you guys tell me you're ready.

rhwood commented 7 years ago

They will reliably appear, they will be controllable, so if someone wants debug level output, that can be turned on only for that user without a source code change. Dumping to STDOUT/ERR does not ensure the message is logged, as not all uses of the JMRI libraries capture that in output in logs.

pabender commented 7 years ago

Ok, merging.

pabender commented 7 years ago

@balazsracz go ahead and run the script when you can.