func init() { env.Load() var err error var chanlen int chanlen, err = strconv.Atoi(os.Getenv("LOG_CACHE_LEN")) if err != nil || chanlen == 0 { chanlen = 10000 } l = log5.NewLog(uint64(chanlen)) level := os.Getenv("LOG_LEVEL") if level != "" { l.SetLevel(level) } engine := os.Getenv("LOG_ENGINE") if engine == "file" { logfile := os.Getenv("LOG_FILE_NAME") logspilt := os.Getenv("LOG_FILE_SPILT") logsize := os.Getenv("LOG_FILE_SIZE") lfconf := fmt.Sprintf(`{"spilt":"%s","filename":"%s","maxsize":"%s"}`, logspilt, logfile, logsize) l = l.SetEngine(engine, lfconf) } funccall := os.Getenv("LOG_FUNC_CALL") if funccall == "true" { l.SetFuncCall(true).SetFuncCallDepth(3) } }
func initialize() { env.Load() }