logger/fatal.go

13 lines
225 B
Go
Raw Normal View History

2023-11-23 07:39:52 +00:00
package logger
import (
"encoding/json"
"go.uber.org/zap"
)
// Fatal ...
2023-11-24 02:50:50 +00:00
func Fatal(content string, data interface{}) {
2023-11-23 07:39:52 +00:00
jsonData, _ := json.Marshal(data)
zapLogger.Fatal(content, zap.String("data", string(jsonData)))
}