Ejemplo
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
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- go
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- go
- Lenguaje
- go
- Gestor de paquetes
- go
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- go 1.26
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- go 1.26
- Lenguaje
- go
- Gestor de paquetes
- go
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Caso
- Objetivo
- Dynamically modify zap 1.28.0 logging levels at runtime via zap.AtomicLevel across base and derived loggers without reinitializing logger instances HOW
- Paquetes
-
go.uber.org/zap 1.28.0
- Entorno
- go
- Creado
- 2026-08-17T18:55:42Z
Contrato
- 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
Archivos
- NOTES.md
- atomic_level_test.go
- csx.json
- go.mod
- go.sum
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9