MCPcopy
hub / github.com/grafana/dskit / Set

Method Set

log/level.go:59–75  ·  view source on GitHub ↗

Set updates the value of the allowed level. Implments flag.Value.

(s string)

Source from the content-addressed store, hash-verified

57
58// Set updates the value of the allowed level. Implments flag.Value.
59func (l *Level) Set(s string) error {
60 switch s {
61 case "debug":
62 l.Option = level.AllowDebug()
63 case "info":
64 l.Option = level.AllowInfo()
65 case "warn":
66 l.Option = level.AllowWarn()
67 case "error":
68 l.Option = level.AllowError()
69 default:
70 return errors.Errorf("unrecognized log level %q", s)
71 }
72
73 l.s = s
74 return nil
75}

Callers 14

createLoggerFunction · 0.95
TestLazySprintfFunction · 0.95
RegisterFlagsMethod · 0.95
UnmarshalYAMLMethod · 0.95
TestMarshalYAMLFunction · 0.95
TestRunReturnsErrorFunction · 0.95
TestMiddlewareLoggingFunction · 0.95
TestTLSServerFunction · 0.95
TestLogSourceIPsFunction · 0.95

Calls 1

ErrorfMethod · 0.80

Tested by 12

createLoggerFunction · 0.76
TestLazySprintfFunction · 0.76
TestMarshalYAMLFunction · 0.76
TestRunReturnsErrorFunction · 0.76
TestMiddlewareLoggingFunction · 0.76
TestTLSServerFunction · 0.76
TestLogSourceIPsFunction · 0.76
TestOTelTracingFunction · 0.76
TestHTTPGRPCTracingFunction · 0.76