java-decompiler: do not indent log by unprinted messages

This commit is contained in:
Roman Shevchenko 2014-10-14 18:33:37 +02:00
parent 6889e7435a
commit 46b494f26f

View File

@ -39,56 +39,72 @@ public class PrintStreamLogger extends IFernflowerLogger {
@Override @Override
public void writeMessage(String message, Throwable t) { public void writeMessage(String message, Throwable t) {
writeMessage(message, Severity.ERROR);
if (accepts(Severity.ERROR)) { if (accepts(Severity.ERROR)) {
writeMessage(message, Severity.ERROR);
t.printStackTrace(stream); t.printStackTrace(stream);
} }
} }
@Override @Override
public void startReadingClass(String className) { public void startReadingClass(String className) {
writeMessage("Decompiling class " + className, Severity.INFO); if (accepts(Severity.INFO)) {
++indent; writeMessage("Decompiling class " + className, Severity.INFO);
++indent;
}
} }
@Override @Override
public void endReadingClass() { public void endReadingClass() {
--indent; if (accepts(Severity.INFO)) {
writeMessage("... done", Severity.INFO); --indent;
writeMessage("... done", Severity.INFO);
}
} }
@Override @Override
public void startClass(String className) { public void startClass(String className) {
writeMessage("Processing class " + className, Severity.TRACE); if (accepts(Severity.INFO)) {
++indent; writeMessage("Processing class " + className, Severity.TRACE);
++indent;
}
} }
@Override @Override
public void endClass() { public void endClass() {
--indent; if (accepts(Severity.INFO)) {
writeMessage("... proceeded", Severity.TRACE); --indent;
writeMessage("... proceeded", Severity.TRACE);
}
} }
@Override @Override
public void startMethod(String methodName) { public void startMethod(String methodName) {
writeMessage("Processing method " + methodName, Severity.TRACE); if (accepts(Severity.INFO)) {
++indent; writeMessage("Processing method " + methodName, Severity.TRACE);
++indent;
}
} }
public void endMethod() { public void endMethod() {
--indent; if (accepts(Severity.INFO)) {
writeMessage("... proceeded", Severity.TRACE); --indent;
writeMessage("... proceeded", Severity.TRACE);
}
} }
@Override @Override
public void startWriteClass(String className) { public void startWriteClass(String className) {
writeMessage("Writing class " + className, Severity.TRACE); if (accepts(Severity.INFO)) {
++indent; writeMessage("Writing class " + className, Severity.TRACE);
++indent;
}
} }
@Override @Override
public void endWriteClass() { public void endWriteClass() {
--indent; if (accepts(Severity.INFO)) {
writeMessage("... written", Severity.TRACE); --indent;
writeMessage("... written", Severity.TRACE);
}
} }
} }