cic-custodial/pkg/logg/logg.go
2022-11-30 09:51:24 +00:00

25 lines
365 B
Go

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)
}