logger/error.go

14 lines
222 B
Go
Raw Normal View History

2021-08-09 03:49:23 +00:00
package logger
import (
"encoding/json"
"go.uber.org/zap"
)
// Error ...
func Error(content string, data LogData) {
jsonData, _ := json.Marshal(data)
zapLogger.Error(content, zap.String("data", string(jsonData)))
}