java-opentimestamps
java-opentimestamps copied to clipboard
SLF4J support
This is based on the conversation over on opentimestamps/java-opentimestamps#48. I have migrated the project from using java.util.logging
to SLF4J. This should make it easier for those depending on this library to control the logging that is coming out of the library.
There are some changes to how the CLI application needs to be built. Now when creating the OtsCli.jar it should be built with mvn install -P cli
which will activate the CLI profile. This adds Logback Classic and a basic stdout log appender configuration to the CLI jar. This will allow log messages to be emitted on the command line.
All references to java.util.logging
have now been removed with SLF4J as the preferred approach. Also the tests have a dependency on Logback Classic to ensure that the correct log message is output on one of the tests.
Remaining tasks
- [ ] Test this with an existing application to make sure that the logging can be configured as required.
Isn't java.util.logging more agnostic so that dependent library could choose which logging implementation do they prefer?
Can't we follow @lvaccaro suggestion https://github.com/opentimestamps/java-opentimestamps/issues/48#issuecomment-715943964 remove slf4j from the lib, then maybe use logback/slf4j in the cli profile?
Yep, that's probably a good idea. I'll get this updated to use that in preference to SLF4J.