diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 59b744c..764b4d4 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -529,7 +529,9 @@ public class ClassWriter { buffer.append(root.toJava(indent, tracer)); } catch (Throwable ex) { - DecompilerContext.getLogger().writeMessage("Method " + mt.getName() + " " + mt.getDescriptor() + " couldn't be written.", ex); + DecompilerContext.getLogger().writeMessage("Method " + mt.getName() + " " + mt.getDescriptor() + " couldn't be written.", + IFernflowerLogger.Severity.WARN, + ex); methodWrapper.decompiledWithErrors = true; } } @@ -832,7 +834,10 @@ public class ClassWriter { buffer.append(code); } catch (Throwable ex) { - DecompilerContext.getLogger().writeMessage("Method " + mt.getName() + " " + mt.getDescriptor() + " couldn't be written.", ex); + DecompilerContext.getLogger() + .writeMessage("Method " + mt.getName() + " " + mt.getDescriptor() + " couldn't be written.", + IFernflowerLogger.Severity.WARN, + ex); methodWrapper.decompiledWithErrors = true; } } diff --git a/src/org/jetbrains/java/decompiler/main/decompiler/PrintStreamLogger.java b/src/org/jetbrains/java/decompiler/main/decompiler/PrintStreamLogger.java index a201000..5ed82ed 100644 --- a/src/org/jetbrains/java/decompiler/main/decompiler/PrintStreamLogger.java +++ b/src/org/jetbrains/java/decompiler/main/decompiler/PrintStreamLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,9 +38,9 @@ public class PrintStreamLogger extends IFernflowerLogger { } @Override - public void writeMessage(String message, Throwable t) { - if (accepts(Severity.ERROR)) { - writeMessage(message, Severity.ERROR); + public void writeMessage(String message, Severity severity, Throwable t) { + if (accepts(severity)) { + writeMessage(message, severity); t.printStackTrace(stream); } } diff --git a/src/org/jetbrains/java/decompiler/main/extern/IFernflowerLogger.java b/src/org/jetbrains/java/decompiler/main/extern/IFernflowerLogger.java index db76c77..23d5c63 100644 --- a/src/org/jetbrains/java/decompiler/main/extern/IFernflowerLogger.java +++ b/src/org/jetbrains/java/decompiler/main/extern/IFernflowerLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,11 @@ public abstract class IFernflowerLogger { public abstract void writeMessage(String message, Severity severity); - public abstract void writeMessage(String message, Throwable t); + public abstract void writeMessage(String message, Severity severity, Throwable t); + + public void writeMessage(String message, Throwable t) { + writeMessage(message, Severity.ERROR, t); + } public void startReadingClass(String className) { } diff --git a/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java b/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java index fdabfde..3a3346e 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java +++ b/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java @@ -142,7 +142,9 @@ public class ClassWrapper { } } catch (Throwable ex) { - DecompilerContext.getLogger().writeMessage("Method " + mt.getName() + " " + mt.getDescriptor() + " couldn't be decompiled.", ex); + DecompilerContext.getLogger().writeMessage("Method " + mt.getName() + " " + mt.getDescriptor() + " couldn't be decompiled.", + IFernflowerLogger.Severity.WARN, + ex); isError = true; }