diff --git a/logx/log.go b/logx/log.go index 7a2e117..6d10af0 100644 --- a/logx/log.go +++ b/logx/log.go @@ -1,5 +1,11 @@ package logx +var std = NewLogrus() + +func StandardLogger() Logger { + return std +} + // Fields type, used to pass to `WithFields`. type Fields map[string]any @@ -13,7 +19,7 @@ type Logger interface { Debugf(format string, args ...any) Info(args ...any) Infof(format string, args ...any) - Warn(args ...any) + Warn(args ...any) Warnf(format string, args ...any) Error(args ...any) Errorf(format string, args ...any) diff --git a/logx/logrus.go b/logx/logrus.go index 09edbcd..81f1396 100644 --- a/logx/logrus.go +++ b/logx/logrus.go @@ -18,7 +18,7 @@ func NewLogrus() Logger { logger.SetFormatter( &nested.Formatter{ - TimestampFormat: "2006-01-02 15:04:05.999", + TimestampFormat: "2006-01-02 15:04:05.000", NoColors: false, CustomCallerFormatter: nestedCallerFormatter, }) @@ -88,7 +88,7 @@ func (l *logrusWrpper) Errorf(format string, args ...any) { } func (l *logrusWrpper) Fatal(args ...any) { - l.logrus.Fatal(args) + l.logrus.Fatal(args...) } func (l *logrusWrpper) Fatalf(format string, args ...any) {