New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logback conversion #889
Logback conversion #889
Conversation
Rather than attempt to do all of the logback configuration in the ReflectedUniverse, this commits moves the LB logic out into LogbackTools and only references those static methods from the ReflectedUniverse. The next step will be to do this behind a SPI interface.
logback is also found in the artifacts directory during execution causing a warning to be printed during testing.
If log4j is present in ImageJ1 and is found before logback, then having explicit imports of logback classes in key loci-plugins classes will prevent Bio-Formats from working at all. This commit follows the previous strategy of hiding the hefty lifting in LogbackTools and just referencing those methods safely from a ReflectedUniverse in DebugTools.
The Maven build should now pass.
Build and default logging fixes
@sbesson : are you ok to test out the state of matlab logging with a merge build including joshmoore#2 ? |
Here seems to be the state of this PR as far as I can tell (with @melissalinkert's PR merged): IJ2+bioformats_package.jar+no logging jarssh run in ImageJ prints IJ2+bioformats_package.jar+logback jarsWorks as expected. Edit>Options>Debug clearly shows BF logging 👍 IJ2+bioformats_package.jar+log4j jarsNothing on the console: 👍 Next step is to examine the CI fixes. |
Status update:
|
This reverts commit 9b1a957.
In order to match the behavior in MATLAB with 4.4, `DebugTools.enableLogging("INFO")` etc. should continue to work. Since log4j is shipped with MATLAB 2013, the only way for this to function is for us to fallback to configuring Log4j if Logback is not present. Note: the use of `LOGGER.debug` in `ReflectedUniverse` makes it unusable for the initial logging configuration. Likely all uses of LOGGER should be removed from RU which shouldn't be an issue since for each log statement a `ReflectException` with the same message is thrown.
With the last change, the following seems to work:
However, I'm not sure which logback.xml file is getting used (if any). |
With the last commit (4579666), the above Jython tests also work with the mvn jars:
|
Using Bio-Formats 4.4.10
Using the
I guess that's a 👍 from the MATLAB side |
Fix test suite's logback.xml to write to a logfile
|
Adding
which looks good to me. |
Great, thanks, @ximenesuk. Merging to open another PR. |
I do not have the error output in the logging window when having just "loci_tools.jar" in the plugins folder. cf section "Bio-formats only" of https://docs.google.com/document/d/1O5xQqhFpWi1zlMwgDn75qvtYwCXmTCLToIs8M5fYQVA/edit# |
--rebased-to #910 |
This PR moves any explicit use of log4j to logback. No
log4j.properties
or similar should remain in the repository, and it should in fact be possible to remove the log4j jars.A next step will be to remove all hard-coded dependencies on any slf4j binding, perhaps by providing our own which delegates.
Testing instructions will be forthcoming. Certainly all of the merge/test jobs (openbytes, performance, full-repo, test_images_good) need to continue to work as expected.