Skip to content

Commit

Permalink
"Fix" logger from failing to print a message
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Dec 3, 2024
1 parent b0db2f8 commit eadc7d1
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,30 @@ private LoggingFailureCollector() {

@Override
public void warning(String details) {
Log.warn(details);
Log.warn(escape(details));
}

@Override
public void warning(String details, Exception exception) {
Log.warnf(exception, details);
Log.warnf(exception, escape(details));
}

@Override
public void critical(String details) {
Log.error(details);
Log.error(escape(details));
}

@Override
public void critical(String details, Exception exception) {
Log.errorf(exception, details);
Log.errorf(exception, escape(details));
}

@Override
public void close() {
// do nothing, we've already logged all
}

private String escape(String s) {
return s.replace('{', '[').replace('}', ']');
}
}

0 comments on commit eadc7d1

Please sign in to comment.