MCPcopy
hub / github.com/safing/portmaster / SetLogLevel

Function SetLogLevel

base/log/logging.go:147–160  ·  view source on GitHub ↗

SetLogLevel sets a new log level. Only effective after Start().

(level Severity)

Source from the content-addressed store, hash-verified

145
146// SetLogLevel sets a new log level. Only effective after Start().
147func SetLogLevel(level Severity) {
148 previous := GetLogLevel()
149
150 atomic.StoreUint32(logLevel, uint32(level))
151
152 // Setup slog here for the transition period.
153 setupSLog(level)
154
155 // Write directly to GlobalWriter (bypassing the level filter) so the
156 // message is always visible regardless of the current or new level.
157 if previous != level {
158 writeLogLevelChange(previous.Name(), level.Name())
159 }
160}
161
162// Name returns the name of the log level.
163func (s Severity) Name() string {

Callers 5

mainFunction · 0.92
runTestFunction · 0.92
setLogLevelFunction · 0.92
StartFunction · 0.85
TestLoggingFunction · 0.85

Calls 4

GetLogLevelFunction · 0.85
setupSLogFunction · 0.85
writeLogLevelChangeFunction · 0.85
NameMethod · 0.65

Tested by 2

runTestFunction · 0.74
TestLoggingFunction · 0.68