Exemple
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
Preuves d'exécution
L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.
Base de preuveContrat signé réussi
Reçus de vérification1
Niveau de vérificationL3_CONTRACT_PASS
Environnement déclaré
- Contexte d'exécution
- go
- Système d'exploitation
- linux
- Architecture
- x64
- Runtime
- go
- Langage
- go
- Gestionnaire de paquets
- go
Environnements des exécutions de vérification
- Contexte d'exécution
- go 1.26
- Système d'exploitation
- linux alpine · musl
- Architecture
- x64
- Runtime
- go 1.26
- Langage
- go
- Gestionnaire de paquets
- go
- Exécution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Cas
- Objectif
- Dynamically modify zap 1.28.0 logging levels at runtime via zap.AtomicLevel across base and derived loggers without reinitializing logger instances HOW
- Paquets
-
go.uber.org/zap 1.28.0
- Environnement
- go
- Créé
- 2026-08-17T18:55:42Z
Contrat
- 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
Fichiers
- NOTES.md
- atomic_level_test.go
- csx.json
- go.mod
- go.sum
Télécharger l’artefact source (tar.gz)
Seeder d'origine
csx-seed
Reçus de vérification
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9