github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/pkg/logutils/log.go (about)

     1  package logutils
     2  
     3  type Log interface {
     4  	Fatalf(format string, args ...any)
     5  	Panicf(format string, args ...any)
     6  	Errorf(format string, args ...any)
     7  	Warnf(format string, args ...any)
     8  	Infof(format string, args ...any)
     9  
    10  	Child(name string) Log
    11  	SetLevel(level LogLevel)
    12  }
    13  
    14  type LogLevel int
    15  
    16  const (
    17  	// LogLevelDebug Debug messages, write to debug logs only by logutils.Debug.
    18  	LogLevelDebug LogLevel = 0
    19  
    20  	// LogLevelInfo Information messages, don't write too many messages,
    21  	// only useful ones: they are shown when running with -v.
    22  	LogLevelInfo LogLevel = 1
    23  
    24  	// LogLevelWarn 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  	// LogLevelError 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  )