cic-custodial/pkg/logg/logg.go

25 lines
365 B
Go
Raw Normal View History

2022-11-30 10:51:24 +01:00
package logg
import "github.com/zerodha/logf"
type LoggOpts struct {
Debug bool
Caller bool
Color bool
}
func NewLogg(o LoggOpts) logf.Logger {
loggConfig := logf.Opts{
EnableColor: o.Color,
EnableCaller: o.Caller,
}
if o.Debug {
loggConfig.Level = logf.DebugLevel
} else {
loggConfig.Level = logf.InfoLevel
}
return logf.New(loggConfig)
}