refactor: verbose doesn't adapt handler (#3310)

This commit is contained in:
Connor Tumbleson 2023-09-03 07:06:44 -04:00 committed by GitHub
parent c7915cd6cb
commit dcb6788243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View File

@ -592,11 +592,18 @@ public class Main {
return;
}
Handler handler = new Handler(){
Handler handler = new Handler() {
@Override
public void publish(LogRecord record) {
if (getFormatter() == null) {
setFormatter(new SimpleFormatter());
setFormatter(new Formatter() {
@Override
public String format(LogRecord record) {
return record.getLevel().toString().charAt(0) + ": "
+ record.getMessage()
+ System.getProperty("line.separator");
}
});
}
try {
@ -616,6 +623,7 @@ public class Main {
reportError(null, exception, ErrorManager.FORMAT_FAILURE);
}
}
@Override
public void close() throws SecurityException {}
@Override
@ -627,15 +635,6 @@ public class Main {
if (verbosity == Verbosity.VERBOSE) {
handler.setLevel(Level.ALL);
logger.setLevel(Level.ALL);
} else {
handler.setFormatter(new Formatter() {
@Override
public String format(LogRecord record) {
return record.getLevel().toString().charAt(0) + ": "
+ record.getMessage()
+ System.getProperty("line.separator");
}
});
}
}

View File

@ -207,7 +207,7 @@ public class ARSCDecoder {
mHeader.checkForUnreadHeader(mIn);
for (int i = 0; i < count; i++) {
LOGGER.fine(String.format("Skipping staged alias stagedId (%h) finalId: %h", mIn.readInt(), mIn.readInt()));
LOGGER.fine(String.format("Staged alias: 0x%08x -> 0x%08x", mIn.readInt(), mIn.readInt()));
}
}