Skip to content

Commit 43887f1

Browse files
committed
fix json formatter error
1 parent a7937e4 commit 43887f1

File tree

1 file changed

+3
-0
lines changed
  • framework/provider/log/formatter

1 file changed

+3
-0
lines changed

framework/provider/log/formatter/json.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import (
1212

1313
func JsonFormatter(level contract.LogLevel, t time.Time, msg string, fields map[string]interface{}) ([]byte, error) {
1414
bf := bytes.NewBuffer([]byte{})
15+
if fields == nil {
16+
fields = map[string]interface{}{}
17+
}
1518
fields["msg"] = msg
1619
fields["level"] = level
1720
fields["timestamp"] = t.Format(time.RFC3339)

0 commit comments

Comments
 (0)