Skip to content

Commit

Permalink
Slightly more accurate PDF creation logging
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Sep 26, 2023
1 parent 642610f commit c62b9eb
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,20 @@ public class PdfResponseHandler {
XRLog.setLoggerImpl(new XRLogger() {
@Override
public void log(String where, Level level, String msg) {
logger.log(where, translate(level), msg, null, null);
// FIXME: dropped where because if I set it, it appears as <unknown>" in the logs and I can't even enable the logs
logger.log(translate(level), msg);
}

@Override
public void log(String where, Level level, String msg, Throwable th) {
// FIXME: dropped where because if I set it, it appears as <unknown>" in the logs and I can't even enable the logs
logger.log(translate(level), msg, th);
}

private org.jboss.logging.Logger.Level translate(Level level) {
// downgrade INFO which is too verbose
if (level == Level.INFO)
return Logger.Level.TRACE;
return Logger.Level.DEBUG;
// the rest is a best guess
if (level == Level.WARNING)
return Logger.Level.WARN;
Expand All @@ -52,11 +59,6 @@ private org.jboss.logging.Logger.Level translate(Level level) {
return Logger.Level.INFO;
}

@Override
public void log(String where, Level level, String msg, Throwable th) {
logger.log(where, translate(level), msg, null, th);
}

@Override
public void setLevel(String logger, Level level) {
}
Expand Down

0 comments on commit c62b9eb

Please sign in to comment.