Skip to content
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

Move logging configuration to beginning of call() method #233

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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));
}
Expand Down
Loading