level.go 483 B

1234567891011121314151617181920212223242526272829
  1. package log
  2. // Level of severity.
  3. type Level int
  4. // Verbose is a boolean type that implements Info, Infov (like Printf) etc.
  5. type Verbose bool
  6. // common log level.
  7. const (
  8. _debugLevel Level = iota
  9. _infoLevel
  10. _warnLevel
  11. _errorLevel
  12. _fatalLevel
  13. )
  14. var levelNames = [...]string{
  15. _debugLevel: "DEBUG",
  16. _infoLevel: "INFO",
  17. _warnLevel: "WARN",
  18. _errorLevel: "ERROR",
  19. _fatalLevel: "FATAL",
  20. }
  21. // String implementation.
  22. func (l Level) String() string {
  23. return levelNames[l]
  24. }