Skip to content

Commit

Permalink
Don't show stack trace when logging something that's not an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Sep 22, 2024
1 parent 6f477a4 commit 1a31b48
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static CoreException log(int errorLevel, String message, Throwable e) {
id = plugin.getBundle().getSymbolicName();
}

Status s = new Status(errorLevel, id, errorLevel, message, e);
Status s = new Status(errorLevel, id, errorLevel, message, errorLevel >= IStatus.ERROR ? e : null);
CoreException coreException = new CoreException(s);

Tuple<Integer, String> key = new Tuple<Integer, String>(errorLevel, message);
Expand All @@ -90,8 +90,8 @@ public static CoreException log(int errorLevel, String message, Throwable e) {
if (SharedCorePlugin.inTestMode()) {
if (DEBUG_LEVEL <= errorLevel) {
System.err.println(message);
if (e != null) {
e.printStackTrace();
if (s.getException() != null) {
s.getException().printStackTrace();
}
}
} else {
Expand Down

0 comments on commit 1a31b48

Please sign in to comment.