From c6f1b02ed4da7ac761b5d9a3dbbc38fe612524ed Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 20 Jun 2020 06:29:51 +0000 Subject: [PATCH] fix invalid timestamp while print log string --- src/util/src/tlog.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index c4597d86ed..599cf3262b 100644 --- a/src/util/src/tlog.c +++ b/src/util/src/tlog.c @@ -428,8 +428,12 @@ void taosPrintLongString(const char *flags, int32_t dflag, const char *format, . buffer[len] = 0; if ((dflag & DEBUG_FILE) && tsLogObj.logHandle && tsLogObj.logHandle->fd >= 0) { - taosPushLogBuffer(tsLogObj.logHandle, buffer, len); - + if (tsAsyncLog) { + taosPushLogBuffer(tsLogObj.logHandle, buffer, len); + } else { + twrite(tsLogObj.logHandle->fd, buffer, len); + } + if (tsLogObj.maxLines > 0) { atomic_add_fetch_32(&tsLogObj.lines, 1);