Beispiel #1
0
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)
}
Beispiel #2
0
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)
}
Beispiel #3
0
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)
	}
}
Beispiel #4
0
func NewLogger(bufLen int64, mode, config string) {
	logger = logs.NewLogger(bufLen)
	logger.SetLogger(mode, config)
}
Beispiel #5
0
func init() {
	logger = logs.NewLogger(10000)
	logger.SetLogger("console", `{"level": 0}`)
}
Beispiel #6
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))
}