cfg.go 798 B

1234567891011121314151617181920212223242526272829303132333435
  1. package cfg
  2. import (
  3. "fmt"
  4. "path/filepath"
  5. ucfg "git.wecise.com/wecise/util/cfg"
  6. ulog "git.wecise.com/wecise/util/logger"
  7. )
  8. var Config = ucfg.MConfig(&ucfg.CfgOption{
  9. Name: "m:default",
  10. Type: ucfg.INI_TEXT,
  11. Values: []string{`
  12. [log]
  13. level=debug
  14. dir=` + filepath.Join("/", "opt", "matrix", "var", "logs") + `
  15. file=` + "cgimport.log" + `
  16. console=true
  17. color=true
  18. consolelevel=info
  19. format=yyyy-MM-dd HH:mm:ss.SSSSSS [pid] [level] module/file:line msg
  20. eol=\n
  21. size=10MB
  22. count=100
  23. scroll=1d
  24. expire=14d
  25. `}},
  26. ucfg.GetIniFileCfgOption(filepath.Join(fmt.Sprint("cgimport", ".conf"))),
  27. ucfg.GetIniFileCfgOption(filepath.Join(fmt.Sprint(ucfg.DefaultAppName, ".conf"))),
  28. ucfg.CFGOPTION_ENVS,
  29. ucfg.CFGOPTION_ARGS)
  30. var Logger = ulog.New().WithConfig(Config, "log")
  31. var LogFile = Logger.FileOutPath()