ilogger.go 741 B

1234567891011121314151617181920212223242526272829303132333435
  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. type LogLevel int
  6. const (
  7. // !nashtsai! following level also match syslog.Priority value
  8. LOG_DEBUG LogLevel = iota
  9. LOG_INFO
  10. LOG_WARNING
  11. LOG_ERR
  12. LOG_OFF
  13. LOG_UNKNOWN
  14. )
  15. // logger interface
  16. type ILogger interface {
  17. Debug(v ...interface{})
  18. Debugf(format string, v ...interface{})
  19. Error(v ...interface{})
  20. Errorf(format string, v ...interface{})
  21. Info(v ...interface{})
  22. Infof(format string, v ...interface{})
  23. Warn(v ...interface{})
  24. Warnf(format string, v ...interface{})
  25. Level() LogLevel
  26. SetLevel(l LogLevel)
  27. ShowSQL(show ...bool)
  28. IsShowSQL() bool
  29. }