You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
340 B
Go
14 lines
340 B
Go
2 years ago
|
package logging
|
||
|
|
||
|
import (
|
||
|
"go.uber.org/zap"
|
||
|
"go.uber.org/zap/zapcore"
|
||
|
)
|
||
|
|
||
|
func NewZapLogger() (*zap.Logger, error) {
|
||
|
zapCfg := zap.NewDevelopmentConfig()
|
||
|
zapCfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
|
||
|
zapCfg.EncoderConfig.EncodeTime = zapcore.TimeEncoderOfLayout("2006/01/02 15:04:05.000")
|
||
|
return zapCfg.Build()
|
||
|
}
|