mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2024-11-05 23:26:46 +01:00
25 lines
365 B
Go
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)
|
|
}
|