Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

feat(logging): Migrate to Go structured logging with slog

オープン
#970 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go
領域
backend, cli

調査の方向性

まず pkg/unikontainers/、pkg/containerd-shim/、cmd/urunc/ にある log.Printf と fmt.Printf の使用箇所を洗い出し、次に CLI の起動パスを調べて、フラグを初期化できる場所を確認します。これらの領域で一元化された slog のセットアップが使用され、ログレベルとログ形式のフラグが機能し、JSON 出力が有効で、動作が変わらなければ作業は完了です。

索引モデルが issue の本文から書いたものです。

説明

invalid Stale

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

  1. Introduce a centralized logger in pkg/ or internal/ using log/slog.
  2. Replace log.Printf / fmt.Printf logging calls with slog.Info, slog.Debug, slog.Error across:
    • pkg/unikontainers/ (VM lifecycle, network, initrd)
    • pkg/containerd-shim/ (shim operations)
    • cmd/urunc/ (CLI commands)
  3. Add a --log-format flag to urunc CLI supporting text (default) and json.
  4. Add a --log-level flag supporting debug, 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, containerd both use structured logging).
  • Zero external dependencies slog is in the standard library.

Acceptance Criteria

  • slog logger is initialized at program startup with configurable level/format.
  • All existing log calls migrated to structured equivalents.
  • urunc --log-level=debug --log-format=json produces valid JSON logs.
  • No functional behavior changes purely logging migration.

Non-Priorities

  • Adding new logging frameworks (zap, zerolog, etc.)slog only.
  • Changing error handling logic.
  • Adding new features beyond logging.

I can start with pkg/unikontainers/ and then move on from there...

主要言語
Go
スター
306
フォーク
214
平均マージ
2日 23時間
マージ済み PR(30日)
26

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

urunc-dev/urunc のほかの issue

urunc-dev/urunc の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。