MCPcopy
hub / github.com/charmbracelet/log / String

Method String

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

String returns the string representation of the level.

()

Source from the content-addressed store, hash-verified

27
28// String returns the string representation of the level.
29func (l Level) String() string {
30 switch l {
31 case DebugLevel:
32 return "debug"
33 case InfoLevel:
34 return "info"
35 case WarnLevel:
36 return "warn"
37 case ErrorLevel:
38 return "error"
39 case FatalLevel:
40 return "fatal"
41 default:
42 return ""
43 }
44}
45
46// ErrInvalidLevel is an error returned when parsing an invalid level string.
47var ErrInvalidLevel = errors.New("invalid level")

Callers 15

TestLogContext_fieldsFunction · 0.45
TestCallerFormatterFunction · 0.45
TestGlobalFunction · 0.45
TestPrintFunction · 0.45
TestPrintfFunction · 0.45
TestDebugfFunction · 0.45
TestInfofFunction · 0.45
TestWarnfFunction · 0.45
TestErrorfFunction · 0.45
TestWithFunction · 0.45
TestPrefixFunction · 0.45
TestFormatterFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestLogContext_fieldsFunction · 0.36
TestCallerFormatterFunction · 0.36
TestGlobalFunction · 0.36
TestPrintFunction · 0.36
TestPrintfFunction · 0.36
TestDebugfFunction · 0.36
TestInfofFunction · 0.36
TestWarnfFunction · 0.36
TestErrorfFunction · 0.36
TestWithFunction · 0.36
TestPrefixFunction · 0.36
TestFormatterFunction · 0.36