logger.go 491 B

123456789101112131415161718192021222324252627
  1. package config
  2. import "gogs.baozhida.cn/zoie/OAuth-core/pkg/logger"
  3. type Logger struct {
  4. Type string
  5. Path string
  6. Level string
  7. Stdout string
  8. EnabledDB bool
  9. Cap uint
  10. MaxDays int
  11. }
  12. // Setup 设置logger
  13. func (e Logger) Setup() {
  14. logger.SetupLogger(
  15. logger.WithType(e.Type),
  16. logger.WithPath(e.Path),
  17. logger.WithLevel(e.Level),
  18. logger.WithStdout(e.Stdout),
  19. logger.WithCap(e.Cap),
  20. logger.WithMaxDays(e.MaxDays),
  21. )
  22. }
  23. var LoggerConfig = new(Logger)