Skip to content

Commit

Permalink
Don't set the error manager on the Handler and use the error manager …
Browse files Browse the repository at this point in the history
…from this ExtHandler.

Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Jun 8, 2023
1 parent 591e6fe commit 4e04b64
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/jboss/logmanager/ExtHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class ExtHandler extends Handler implements AutoCloseable, Flush
private volatile Filter filter;
private volatile Formatter formatter;
private volatile Level level = Level.ALL;
private volatile ErrorManager errorManager = new ErrorManager();
private volatile ErrorManager errorManager;
// (skip `encoding` because we replace it with `charset` below)

private volatile boolean autoFlush = true;
Expand All @@ -79,7 +79,7 @@ public abstract class ExtHandler extends Handler implements AutoCloseable, Flush
protected ExtHandler() {
handlersUpdater.clear(this);
closeChildren = true;
super.setErrorManager(DEFAULT_ERROR_MANAGER);
errorManager = DEFAULT_ERROR_MANAGER;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -526,7 +526,8 @@ public boolean isCallerCalculationRequired() {

@Override
protected void reportError(String msg, Exception ex, int code) {
super.reportError(msg, ex, code);
final ErrorManager errorManager = this.errorManager;
errorManager.error(msg, ex, code);
}

/**
Expand Down

0 comments on commit 4e04b64

Please sign in to comment.