From aecffec76542986606f1e730326344b659226dc6 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Tue, 9 Jan 2024 12:40:53 -0600 Subject: [PATCH 1/2] Move logging configuration to beginning of call() method This ensures that the correct log level is set before OpenCV is loaded. --- .../com/glencoesoftware/bioformats2raw/Converter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java index 135fa6f2..c6a60d6e 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java @@ -1090,6 +1090,10 @@ public DimensionOrder getDimensionOrder() { */ @Override public Integer call() throws Exception { + ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) + LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + root.setLevel(Level.toLevel(logLevel)); + if (printVersion) { String version = Optional.ofNullable( this.getClass().getPackage().getImplementationVersion() @@ -1118,10 +1122,6 @@ public Integer call() throws Exception { OpenCVTools.loadOpenCV(); - ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) - LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - root.setLevel(Level.toLevel(logLevel)); - if (progressBars) { setProgressListener(new ProgressBarListener(logLevel)); } From 75cc25aa1b5ca1fa333904cb83d53e733ac3011f Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Wed, 10 Jan 2024 21:09:39 -0600 Subject: [PATCH 2/2] Use "--add-opens ..." default JVM option to suppress illegal access warning from kryo --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 4176526a..f32b4b62 100644 --- a/build.gradle +++ b/build.gradle @@ -96,6 +96,8 @@ distributions { } startScripts { + defaultJvmOpts = ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] + // placing logback.xml somewhere under src/dist/lib/ keeps it out of // bioformats2raw-*.jar but automatically includes it in the distribution zip // the directory containing logback.xml must be explicitly added to the