MCPcopy Create free account
hub / github.com/screego/server / Decode

Method Decode

config/loglevel.go:13–20  ·  view source on GitHub ↗

Decode decodes a string to a log level.

(value string)

Source from the content-addressed store, hash-verified

11
12// Decode decodes a string to a log level.
13func (ll *LogLevel) Decode(value string) error {
14 if level, err := zerolog.ParseLevel(value); err == nil {
15 *ll = LogLevel(level)
16 return nil
17 }
18 *ll = LogLevel(zerolog.InfoLevel)
19 return errors.New("unknown log level")
20}
21
22// AsZeroLogLevel converts the LogLevel to a zerolog.Level.
23func (ll LogLevel) AsZeroLogLevel() zerolog.Level {

Callers 3

TestLogLevel_Decode_failFunction · 0.80
ReadTypedIncomingFunction · 0.80

Calls 1

LogLevelTypeAlias · 0.85

Tested by 2

TestLogLevel_Decode_failFunction · 0.64