From 5b8be57c69afc800083a6a547b1f05a208b04b60 Mon Sep 17 00:00:00 2001 From: kingecg Date: Sun, 10 Dec 2023 00:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20format.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit log 信息添加category --- format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/format.go b/format.go index 48b3fa1..199f6f8 100644 --- a/format.go +++ b/format.go @@ -4,12 +4,12 @@ import ( "fmt" ) -const logTemplate = "[%s] %s - %s\n" +const logTemplate = "[%s] %s : %s - %s\n" func format(logEvent LogEvent) string { data := logEvent.Ts.Format("2006-01-02 15:04:05") msg := fmt.Sprint(logEvent.Data...) - ret := fmt.Sprintf(logTemplate, data, getLogLevelStr(logEvent.Level), msg) + ret := fmt.Sprintf(logTemplate, data, logEvent.Category getLogLevelStr(logEvent.Level), msg) return ret }