Skip to content

Commit

Permalink
fix logging of thread when not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
d-akara committed Jun 5, 2018
1 parent 9cf247e commit d574ea1
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ public static void writeLog(Tracer tracerConfig, String text) {
String time = new java.text.SimpleDateFormat("hh:mm:ss,SSS").format(new java.util.Date());
builder.append(time);
if (tracerConfig.name != null) builder.append(" [" +tracerConfig.name+ "]");
builder.append(" thread:[");
if (logConfig.threadId) builder.append(Thread.currentThread().getId());
if (logConfig.threadName) builder.append(Thread.currentThread().getName());
builder.append("]: ");
if (logConfig.threadId || logConfig.threadName) {
builder.append(" thread:[");
if (logConfig.threadId) builder.append(Thread.currentThread().getId());
if (logConfig.threadName) builder.append(Thread.currentThread().getName());
builder.append("]:");
}
builder.append(' ');
builder.append(text);

if (tracerConfig.logStackFrames != null) appendStackFrames(tracerConfig.logStackFrames, builder);
Expand Down

0 comments on commit d574ea1

Please sign in to comment.