From 6d90d09cb86f5e57aacaee925d510cedaf839cae Mon Sep 17 00:00:00 2001 From: qifengzhang007 <15087404+qifengzhang007@users.noreply.github.com> Date: Thu, 22 Oct 2020 14:09:09 +0800 Subject: [PATCH] =?UTF-8?q?Recorder=E8=BF=BD=E8=B8=AA=E5=87=BD=E6=95=B0tra?= =?UTF-8?q?ce=E5=9C=A8finish=5Fapi=E6=96=87=E4=BB=B6358=E8=A1=8Cscan?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=89=80=E5=9C=A8=E7=9A=84371=E8=A1=8C?= =?UTF-8?q?=E8=A2=AB=E8=B0=83=E7=94=A8=E6=97=B6=EF=BC=8CBeginAt=20?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=B5=8B=E5=80=BC=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC0001-0:0:0=E5=AF=BC=E8=87=B4=E8=BF=BD=E8=B8=AA?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA=E7=9A=84sql=E8=80=97?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E9=99=90=E5=A4=A7.=20(#3657)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 张奇峰 <10515935zwj> --- logger/logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger/logger.go b/logger/logger.go index 6782736c..11619c92 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -64,7 +64,7 @@ var ( LogLevel: Warn, Colorful: true, }) - Recorder = traceRecorder{Interface: Default} + Recorder = traceRecorder{Interface: Default, BeginAt: time.Now()} ) func New(writer Writer, config Config) Interface { @@ -173,7 +173,7 @@ type traceRecorder struct { } func (l traceRecorder) New() *traceRecorder { - return &traceRecorder{Interface: l.Interface} + return &traceRecorder{Interface: l.Interface, BeginAt: time.Now()} } func (l *traceRecorder) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) {