mirror of
https://github.com/Dvorinka/SEEN.git
synced 2026-06-04 20:43:03 +00:00
small fix, don't worry about it
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package logger
|
||||
|
||||
import "go.uber.org/zap"
|
||||
|
||||
func New(env string) *zap.Logger {
|
||||
if env == "production" {
|
||||
log, err := zap.NewProduction()
|
||||
if err == nil {
|
||||
return log
|
||||
}
|
||||
}
|
||||
|
||||
config := zap.NewDevelopmentConfig()
|
||||
config.EncoderConfig.TimeKey = "ts"
|
||||
log, err := config.Build()
|
||||
if err != nil {
|
||||
return zap.Must(zap.NewDevelopment())
|
||||
}
|
||||
|
||||
return log
|
||||
}
|
||||
Reference in New Issue
Block a user