ac128e2f40
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
29 lines
838 B
Go
29 lines
838 B
Go
package log
|
|
|
|
type Level struct {
|
|
level string
|
|
}
|
|
|
|
var (
|
|
// DebugLevel causes all logs to be logged
|
|
DebugLevel = Level{"debug"}
|
|
// InfoLevel causes all logs of level info or more severe to be logged
|
|
InfoLevel = Level{"info"}
|
|
// WarnLevel causes all logs of level warn or more severe to be logged
|
|
WarnLevel = Level{"warn"}
|
|
// ErrorLevel causes all logs of level error or more severe to be logged
|
|
ErrorLevel = Level{"error"}
|
|
// FatalLevel causes only logs of level fatal to be logged
|
|
FatalLevel = Level{"fatal"}
|
|
)
|
|
|
|
// String returns the string representation for Level
|
|
//
|
|
// This is useful when trying to get the string values for Level and mapping level in other external libraries. For example:
|
|
// ```
|
|
// trace.SetLogLevel(kvp.String("loglevel", log.DebugLevel.String())
|
|
// ```
|
|
func (l Level) String() string {
|
|
return l.level
|
|
}
|