ilogger.go 813 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2019 The Xorm Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package core
  5. // LogLevel defines a log level
  6. type LogLevel int
  7. // enumerate all LogLevels
  8. const (
  9. // !nashtsai! following level also match syslog.Priority value
  10. LOG_DEBUG LogLevel = iota
  11. LOG_INFO
  12. LOG_WARNING
  13. LOG_ERR
  14. LOG_OFF
  15. LOG_UNKNOWN
  16. )
  17. // ILogger is a logger interface
  18. type ILogger interface {
  19. Debug(v ...interface{})
  20. Debugf(format string, v ...interface{})
  21. Error(v ...interface{})
  22. Errorf(format string, v ...interface{})
  23. Info(v ...interface{})
  24. Infof(format string, v ...interface{})
  25. Warn(v ...interface{})
  26. Warnf(format string, v ...interface{})
  27. Level() LogLevel
  28. SetLevel(l LogLevel)
  29. ShowSQL(show ...bool)
  30. IsShowSQL() bool
  31. }