允许用户自定义打印的拓展字段

This commit is contained in:
Yun
2025-06-10 15:41:44 +08:00
parent 3ca01077b6
commit 7dc8dbb539
3 changed files with 28 additions and 2 deletions
+2
View File
@@ -46,6 +46,7 @@ func (l *Logger) logger(ctx context.Context, event string, v ...any) {
Gid: getGID(),
Content: v,
TraceId: traceId,
Expand: l.option.expandData,
}
if event == "error" {
@@ -85,4 +86,5 @@ type FormatData struct {
Content interface{} `json:"content,omitempty"`
TraceId string `json:"traceId,omitempty"`
Stack string `json:"stack,omitempty"`
Expand map[string]string `json:"expand,omitempty"`
}