mirror of
https://github.com/nabbar/golib.git
synced 2025-10-05 07:46:56 +08:00
- Remove logger as globals to use dedicated pointer (#104)
# Refactor Logger : - Remove logger as globals to use dedicated pointer - Add compat file to allow retro-compatibility (function are deprecated) - Add field management to allow add custom information - Add option struct to manage options - Add entry struct to manage all log entry - Add multithreading capabilities (with race prevention) - Allow to log to file + stdout/stderr + syslog - Add io.WriteCloser compatibility interface - Add logrus hook to manage option by hook instance - Add capabilities to custom each logfile/syslog/standard independently - Add small test suite # Update Packages for logger new options : - archive - cluster - context - httpcli - httpserver - ldap - tests # Other : - bump dependancies - update minio server for aws test
This commit is contained in:
@@ -76,17 +76,22 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
liblog.EnableColor()
|
||||
liblog.SetLevel(liblog.DebugLevel)
|
||||
liblog.AddGID(true)
|
||||
liblog.FileTrace(true)
|
||||
liblog.SetFormat(liblog.TextFormat)
|
||||
liblog.Timestamp(true)
|
||||
|
||||
liberr.SetModeReturnError(liberr.ErrorReturnCodeErrorTraceFull)
|
||||
|
||||
ctx, cnl = context.WithCancel(context.Background())
|
||||
|
||||
liblog.SetLevel(liblog.DebugLevel)
|
||||
if err := liblog.GetDefault().SetOptions(ctx, &liblog.Options{
|
||||
DisableStandard: false,
|
||||
DisableStack: false,
|
||||
DisableTimestamp: false,
|
||||
EnableTrace: true,
|
||||
TraceFilter: "",
|
||||
DisableColor: false,
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cfgPool = libsrv.PoolServerConfig{cfgSrv01, cfgSrv02, cfgSrv03}
|
||||
cfgPool.MapUpdate(func(cfg libsrv.ServerConfig) libsrv.ServerConfig {
|
||||
cfg.SetParentContext(func() context.Context {
|
||||
|
Reference in New Issue
Block a user