java-decompiler: do not indent log by unprinted messages

master
Roman Shevchenko 10 years ago
parent 6889e7435a
commit 46b494f26f
  1. 18
      src/org/jetbrains/java/decompiler/main/decompiler/PrintStreamLogger.java

@ -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) {
if (accepts(Severity.INFO)) {
writeMessage("Decompiling class " + className, Severity.INFO); writeMessage("Decompiling class " + className, Severity.INFO);
++indent; ++indent;
} }
}
@Override @Override
public void endReadingClass() { public void endReadingClass() {
if (accepts(Severity.INFO)) {
--indent; --indent;
writeMessage("... done", Severity.INFO); writeMessage("... done", Severity.INFO);
} }
}
@Override @Override
public void startClass(String className) { public void startClass(String className) {
if (accepts(Severity.INFO)) {
writeMessage("Processing class " + className, Severity.TRACE); writeMessage("Processing class " + className, Severity.TRACE);
++indent; ++indent;
} }
}
@Override @Override
public void endClass() { public void endClass() {
if (accepts(Severity.INFO)) {
--indent; --indent;
writeMessage("... proceeded", Severity.TRACE); writeMessage("... proceeded", Severity.TRACE);
} }
}
@Override @Override
public void startMethod(String methodName) { public void startMethod(String methodName) {
if (accepts(Severity.INFO)) {
writeMessage("Processing method " + methodName, Severity.TRACE); writeMessage("Processing method " + methodName, Severity.TRACE);
++indent; ++indent;
} }
}
public void endMethod() { public void endMethod() {
if (accepts(Severity.INFO)) {
--indent; --indent;
writeMessage("... proceeded", Severity.TRACE); writeMessage("... proceeded", Severity.TRACE);
} }
}
@Override @Override
public void startWriteClass(String className) { public void startWriteClass(String className) {
if (accepts(Severity.INFO)) {
writeMessage("Writing class " + className, Severity.TRACE); writeMessage("Writing class " + className, Severity.TRACE);
++indent; ++indent;
} }
}
@Override @Override
public void endWriteClass() { public void endWriteClass() {
if (accepts(Severity.INFO)) {
--indent; --indent;
writeMessage("... written", Severity.TRACE); writeMessage("... written", Severity.TRACE);
} }
}
} }

Loading…
Cancel
Save