MCPcopy Index your code
hub / github.com/op/go-logging / LogLevel

Function LogLevel

level.go:44–51  ·  view source on GitHub ↗

LogLevel returns the log level from a string representation.

(level string)

Source from the content-addressed store, hash-verified

42
43// LogLevel returns the log level from a string representation.
44func LogLevel(level string) (Level, error) {
45 for i, name := range levelNames {
46 if strings.EqualFold(name, level) {
47 return Level(i), nil
48 }
49 }
50 return ERROR, ErrInvalidLogLevel
51}
52
53// Leveled interface is the interface required to be able to add leveled
54// logging.

Callers 2

TestLevelStringFunction · 0.85
TestLevelLogLevelFunction · 0.85

Calls 1

LevelTypeAlias · 0.85

Tested by 2

TestLevelStringFunction · 0.68
TestLevelLogLevelFunction · 0.68