Sample
Dynamically modify zap 1.28.0 logging levels at runtime via zap.AtomicLevel across base and derived loggers without reinitializing logger instances
sha256:b4d93830bc0e5b11f48fcdf14a96fdb8c2a50cbdf593162924b6eef58f61301d
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Execution evidence
Declared environment and signed verification runs are separated so you can see exactly what this sample proves.
Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS
Declared environment
- Execution context
- go
- Operating system
- linux
- Architecture
- x64
- Runtime
- go
- Language
- go
- Package manager
- go
Verification-run environments
- Execution context
- go 1.26
- Operating system
- linux alpine · musl
- Architecture
- x64
- Runtime
- go 1.26
- Language
- go
- Package manager
- go
- Execution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Case
- Goal
- Dynamically modify zap 1.28.0 logging levels at runtime via zap.AtomicLevel across base and derived loggers without reinitializing logger instances HOW
- Packages
-
go.uber.org/zap 1.28.0
- Environment
- go
- Created
- 2026-08-17T18:55:42Z
Contract
- zap.NewAtomicLevelAt enables dynamic log level switching at runtime so that calling SetLevel immediately enables debug log emission across base, child, and sugared loggers without reconstructing the core.
- logger.Core().Enabled(zapcore.DebugLevel) transitions from false to true immediately following atomicLevel.SetLevel(zapcore.DebugLevel)
- derived child loggers created via With and SugaredLogger instances share the same AtomicLevel reference and reflect level mutations immediately
- atomicLevel.UnmarshalText updates the filtering threshold dynamically to warn level, suppressing info logs
Files
- NOTES.md
- atomic_level_test.go
- csx.json
- go.mod
- go.sum
Download the source artifact (tar.gz)
Origin Seeder
csx-seed
Verification receipts
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9