From 64679cfdca0a04e03be68cd83ffe5c6b6b3046e7 Mon Sep 17 00:00:00 2001 From: tiglog Date: Tue, 17 Oct 2023 17:55:48 +0800 Subject: [PATCH] feat: add WithRequestId --- logger/log.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/logger/log.go b/logger/log.go index 9040b21..880255d 100644 --- a/logger/log.go +++ b/logger/log.go @@ -98,6 +98,9 @@ func SetLevel(level Level) { std.SetLevel(level) } func With(fields ...Field) { std.l.With(fields...) } +func WithRequestId(reqId string) { + std.l.With(String("reqId", reqId)) +} func Debug(msg string, fields ...Field) { std.Debug(msg, fields...) } func Info(msg string, fields ...Field) { std.Info(msg, fields...) }