From 6f26766c70daecd939eaa78e800af9359f01363f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 22 Feb 2017 17:36:43 +0100 Subject: [PATCH] Fix the "threadTime" log format to be consistent with "thread". --- source/vibe/core/log.d | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/vibe/core/log.d b/source/vibe/core/log.d index 2b9dadc..2bfebcc 100644 --- a/source/vibe/core/log.d +++ b/source/vibe/core/log.d @@ -328,13 +328,18 @@ final class FileLogger : Logger { dst.formattedWrite(") %s] ", pref); break; case Format.threadTime: + dst.put('['); auto tm = msg.time; static if (is(typeof(tm.fracSecs))) auto msecs = tm.fracSecs.total!"msecs"; // 2.069 has deprecated "fracSec" else auto msecs = tm.fracSec.msecs; - m_curFile.writef("[%08X:%08X %d.%02d.%02d %02d:%02d:%02d.%03d %s] ", - msg.threadID, msg.fiberID, - tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second, msecs, - pref); + m_curFile.writef("%d-%02d-%02d %02d:%02d:%02d.%03d ", tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second, msecs); + + if (msg.threadName.length) dst.put(msg.threadName); + else dst.formattedWrite("%08X", msg.threadID); + dst.put('('); + import vibe.core.task : Task; + Task.getThis().getDebugID(dst); + dst.formattedWrite(") %s] ", pref); break; } }