feat(logging): Migrate to Go structured logging with slog
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza inventariando los usos de log.Printf y fmt.Printf en pkg/unikontainers/, pkg/containerd-shim/ y cmd/urunc/, y después inspecciona la ruta de inicio de la CLI para determinar dónde se pueden inicializar los flags. El trabajo estará terminado cuando esas áreas utilicen una configuración centralizada de slog, funcionen los flags de nivel y formato de log, la salida JSON sea válida y el comportamiento no cambie.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
urunc currently uses standard Go logging (log package or fmt.Printf) throughout the codebase. This produces unstructured, plain-text logs that are difficult to filter, query, or aggregate in production deployments.
Go 1.21 introduced log/slog, the standard structured logging package. Migrating to slog would enable leveled logging (Debug, Info, Warn, Error), structured key-value pairs, and JSON output.... all without external dependencies.
Proposed Work
- Introduce a centralized logger in
pkg/orinternal/usinglog/slog. - Replace
log.Printf/fmt.Printflogging calls withslog.Info,slog.Debug,slog.Erroracross:pkg/unikontainers/(VM lifecycle, network, initrd)pkg/containerd-shim/(shim operations)cmd/urunc/(CLI commands)
- Add a
--log-formatflag touruncCLI supportingtext(default) andjson. - Add a
--log-levelflag supportingdebug,info,warn,error.
Why This Matters
- Structured logs enable filtering and aggregation in production (e.g., "show all ERROR logs from network setup").
- JSON output integrates with log aggregation systems (ELK, Loki, CloudWatch).
- Aligns with modern Go practices (
runc,containerdboth use structured logging). - Zero external dependencies
slogis in the standard library.
Acceptance Criteria
-
sloglogger is initialized at program startup with configurable level/format. - All existing log calls migrated to structured equivalents.
-
urunc --log-level=debug --log-format=jsonproduces valid JSON logs. - No functional behavior changes purely logging migration.
Non-Priorities
- Adding new logging frameworks (zap, zerolog, etc.)
slogonly. - Changing error handling logic.
- Adding new features beyond logging.
I can start with pkg/unikontainers/ and then move on from there...
- Lenguaje dominante
- Go
- Estrellas
- 306
- Forks
- 214
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 24
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de urunc-dev/urunc
-
Containers handed over to runc cannot be started, killed or deleted when urunc runs without --rootPosiblemente ocupada @Daksha1611 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
urunc-dev/urunc#1127 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
urunc-deploy cleanup never labels the node, so the cleanup DaemonSet does not runPosiblemente ocupada @Sarthak-Shreshtha01 la tomó hace 3 días. Abiertobug K8s/Tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
documentation enhancement Storage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Rumprun guests receive &, < and > as \u0026, \u003c and \u003ePosiblemente ocupada @Sarthak-Shreshtha01 la tomó hace 9 días. Abiertobug Guests
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
urunc-dev/urunc#1074 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Hooks run concurrently instead of in the listed orderQuizá libre de nuevo @anishmehta24 la tomó hace 14 días y no hay ningún pull request abierto. AbiertoCore enhancement OCI
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
urunc-dev/urunc#1066 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de urunc-dev/urunc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
scaleway/scaleway-cli#6492 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
taskcluster/taskcluster#9284 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Review backlog (docs-currency): operator-reference.md dependency-bot sweep paragraph does not mention the transient-triage wordingPosiblemente ocupada @hivecommons-hive la tomó hoy. Abiertoagent/reviewer approved-direction help wanted hive/claimed-by-scanner
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
hivecommons/hive#13025 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
fluxcd/go-git-providers#329 ·