From 1004333534daca42bcf89d2116a646c8ccb448ef Mon Sep 17 00:00:00 2001 From: kingecg Date: Fri, 6 Jun 2025 20:23:06 +0800 Subject: [PATCH] fix --- format.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/format.go b/format.go index 064d06c..ae295f2 100644 --- a/format.go +++ b/format.go @@ -10,11 +10,14 @@ import ( // LogFormatter is a function type that formats a LogEvent into a string. // Example: -// formatter := func(event LogEvent) string { -// return fmt.Sprintf("[%s] %s: %v", event.Ts.Format("2006-01-02"), event.Level, event.Data) -// } +// +// formatter := func(event LogEvent) string { +// return fmt.Sprintf("[%s] %s: %v", event.Ts.Format("2006-01-02"), event.Level, event.Data) +// } type LogFormatter = func(LogEvent) string +const logTemplate = "[%s] %s : %s - %s\n" + // format is the default formatter that converts a LogEvent to a string using the default template. // It handles both simple values and formatted strings. // Template: "[timestamp] level : category - data"