diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-26 11:45:18 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-26 11:45:31 +1200 |
commit | a0991e9461ef0a6a14ba90aa9a91dc9ce790bce9 (patch) | |
tree | e72e00ee43e78ab45a5a4b1f937ea1218fd2028e /src/org | |
parent | 2110e12e04f9a4dadff74dd39e75e6f0226c5533 (diff) | |
download | traccar-server-a0991e9461ef0a6a14ba90aa9a91dc9ce790bce9.tar.gz traccar-server-a0991e9461ef0a6a14ba90aa9a91dc9ce790bce9.tar.bz2 traccar-server-a0991e9461ef0a6a14ba90aa9a91dc9ce790bce9.zip |
Check if log message is provided
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/helper/Log.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/helper/Log.java b/src/org/traccar/helper/Log.java index 0e7eb64e8..fa732dc9c 100644 --- a/src/org/traccar/helper/Log.java +++ b/src/org/traccar/helper/Log.java @@ -124,10 +124,16 @@ public final class Log { @Override public String format(LogRecord record) { - StringBuilder message = new StringBuilder(record.getMessage()); + StringBuilder message = new StringBuilder(); + + if (record.getMessage() != null) { + message.append(record.getMessage()); + } if (record.getThrown() != null) { - message.append(" - "); + if (message.length() > 0) { + message.append(" - "); + } if (fullStackTraces) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); |