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

Method SetLevel

logger.go:242–246  ·  view source on GitHub ↗

SetLevel sets the current level.

(level Level)

Source from the content-addressed store, hash-verified

240
241// SetLevel sets the current level.
242func (l *Logger) SetLevel(level Level) {
243 l.mu.Lock()
244 defer l.mu.Unlock()
245 atomic.StoreInt64(&l.level, int64(level))
246}
247
248// GetPrefix returns the current prefix.
249func (l *Logger) GetPrefix() string {

Callers 15

NewWithOptionsFunction · 0.95
TestLogContext_fieldsFunction · 0.80
TestWrongLevelFunction · 0.80
TestLogFormatterFunction · 0.80
TestRaceFunction · 0.80
TestCustomLevelFunction · 0.80
TestCustomLevelStyleFunction · 0.80
TestSlogSimpleFunction · 0.80
TestSlogWithFunction · 0.80
TestSlogCustomLevelFunction · 0.80
TestJsonCallerFunction · 0.80
SetLevelFunction · 0.80

Calls

no outgoing calls

Tested by 10

TestLogContext_fieldsFunction · 0.64
TestWrongLevelFunction · 0.64
TestLogFormatterFunction · 0.64
TestRaceFunction · 0.64
TestCustomLevelFunction · 0.64
TestCustomLevelStyleFunction · 0.64
TestSlogSimpleFunction · 0.64
TestSlogWithFunction · 0.64
TestSlogCustomLevelFunction · 0.64
TestJsonCallerFunction · 0.64