Skip to content

Commit

Permalink
Merge pull request #457 from dmlloyd/logmgr-340
Browse files Browse the repository at this point in the history
[LOGMGR-345] Ensure logger FQCN is correct for system logger
  • Loading branch information
jamezp authored Jan 17, 2024
2 parents 0170f71 + f83437b commit adc5f9b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/main/java/org/jboss/logmanager/JBossLoggerFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Map;
import java.util.ResourceBundle;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;

/**
* Implements the {@code System.LoggerFinder}. It will make an attempt to set the {@code java.util.logging.manager}
Expand Down Expand Up @@ -96,6 +97,36 @@ public boolean isLoggable(final Level level) {
return delegate.isLoggable(LEVELS.getOrDefault(level, java.util.logging.Level.INFO));
}

public void log(final Level level, final String msg) {
log(level, null, msg, (Object[]) null);
}

public void log(final Level level, final Supplier<String> msgSupplier) {
if (isLoggable(level)) {
log(level, null, msgSupplier.get(), (Object[]) null);
}
}

public void log(final Level level, final Object obj) {
if (isLoggable(level)) {
this.log(level, null, obj.toString(), (Object[]) null);
}
}

public void log(final Level level, final String msg, final Throwable thrown) {
this.log(level, null, msg, thrown);
}

public void log(final Level level, final Supplier<String> msgSupplier, final Throwable thrown) {
if (isLoggable(level)) {
this.log(level, null, msgSupplier.get(), thrown);
}
}

public void log(final Level level, final String format, final Object... params) {
this.log(level, null, format, params);
}

@Override
public void log(final Level level, final ResourceBundle bundle, final String msg, final Throwable thrown) {
final ExtLogRecord record = new ExtLogRecord(LEVELS.getOrDefault(level, java.util.logging.Level.INFO), msg,
Expand All @@ -114,4 +145,4 @@ public void log(final Level level, final ResourceBundle bundle, final String for
delegate.log(record);
}
}
}
}

0 comments on commit adc5f9b

Please sign in to comment.