From a44cb745d9acb523441d8814a9e39a416330f0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 31 Aug 2022 23:35:43 +0800 Subject: [PATCH] Fix write log timestamp --- log/format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log/format.go b/log/format.go index 96e0364b..4d2bae5d 100644 --- a/log/format.go +++ b/log/format.go @@ -71,7 +71,7 @@ func (f Formatter) Format(ctx context.Context, level Level, tag string, message case f.DisableTimestamp: message = levelString + " " + message case f.FullTimestamp: - message = F.ToString(int(timestamp.Sub(f.BaseTime)/time.Second)) + " " + levelString + " " + message + message = timestamp.Format(f.TimestampFormat) + " " + levelString + " " + message default: message = levelString + "[" + xd(int(timestamp.Sub(f.BaseTime)/time.Second), 4) + "] " + message } @@ -136,7 +136,7 @@ func (f Formatter) FormatWithSimple(ctx context.Context, level Level, tag string case f.DisableTimestamp: message = levelString + " " + message case f.FullTimestamp: - message = F.ToString(int(timestamp.Sub(f.BaseTime)/time.Second)) + " " + levelString + " " + message + message = timestamp.Format(f.TimestampFormat) + " " + levelString + " " + message default: message = levelString + "[" + xd(int(timestamp.Sub(f.BaseTime)/time.Second), 4) + "] " + message }