func NewLogger(bufLen int64, mode, config string) { Mode, Config = mode, config logger = logs.NewLogger(bufLen) logger.EnableFuncCallDepth(true) logger.SetLogFuncCallDepth(4) logger.SetLogger(mode, config) }
func NewLogger(bufLen int64, mode, config string) { logger := logs.NewLogger(bufLen) isExist := false for _, l := range loggers { if l.Adapter == mode { isExist = true l = logger } } if !isExist { loggers = append(loggers, logger) } logger.SetLogFuncCallDepth(3) logger.SetLogger(mode, config) }
func NewLogger(bufLen int64, mode, config string) { logger := logs.NewLogger(bufLen) isExist := false for _, l := range loggers { if l.Adapter == mode { isExist = true l = logger } } if !isExist { loggers = append(loggers, logger) } logger.SetLogFuncCallDepth(3) if err := logger.SetLogger(mode, config); err != nil { Fatal("Fail to set logger(%s): %v", mode, err) } }
func NewLogger(bufLen int64, mode, config string) { logger = logs.NewLogger(bufLen) logger.SetLogger(mode, config) }
func init() { logger = logs.NewLogger(10000) logger.SetLogger("console", `{"level": 0}`) }
func NewGitLogger(logPath string) { os.MkdirAll(path.Dir(logPath), os.ModePerm) GitLogger = logs.NewLogger(0) GitLogger.SetLogger("file", fmt.Sprintf(`{"level":0,"filename":"%s","rotate":false}`, logPath)) }