github.com/elek/golangci-lint@v1.42.2-0.20211208090441-c05b7fcb3a9a/pkg/logutils/log.go (about) 1 package logutils 2 3 type Log interface { 4 Fatalf(format string, args ...interface{}) 5 Panicf(format string, args ...interface{}) 6 Errorf(format string, args ...interface{}) 7 Warnf(format string, args ...interface{}) 8 Infof(format string, args ...interface{}) 9 10 Child(name string) Log 11 SetLevel(level LogLevel) 12 } 13 14 type LogLevel int 15 16 const ( 17 // Debug messages, write to debug logs only by logutils.Debug. 18 LogLevelDebug LogLevel = 0 19 20 // Information messages, don't write too much messages, 21 // only useful ones: they are shown when running with -v. 22 LogLevelInfo LogLevel = 1 23 24 // Hidden errors: non critical errors: work can be continued, no need to fail whole program; 25 // tests will crash if any warning occurred. 26 LogLevelWarn LogLevel = 2 27 28 // Only not hidden from user errors: whole program failing, usually 29 // error logging happens in 1-2 places: in the "main" function. 30 LogLevelError LogLevel = 3 31 )