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.
24 lines
374 B
Go
24 lines
374 B
Go
package logger
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func NewLoggerProduction() (*zap.SugaredLogger, error) {
|
|
logger, err := zap.NewProduction()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return logger.Sugar(), nil
|
|
}
|
|
|
|
func NewLoggerDevelopment() (*zap.SugaredLogger, error) {
|
|
logger, err := zap.NewDevelopment()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return logger.Sugar(), nil
|
|
}
|