Debug With Logger

Use when debugging test failures, investigating behavior, or running tests with BreakdownLogger output. Guides the 3-phase debugging workflow and environment controls. Trigger words - 'debug', 'デバッグ', 'test failure', 'テスト失敗', 'investigate', '調査', 'LOG_LEVEL', 'LOG_KEY'.

tomevault-io bd825b8 2 files · 2.5 KB Updated

File contents

Debug with Logger

3つの直交する制御次元(level×length×key)を段階的に絞り込むことで、根本原因を効率的に特定する。

制御次元

変数 問い
LOG_LEVEL 深刻度 debug/info/warn/error
LOG_LENGTH 詳細度 未設定/S/L/W
LOG_KEY コンポーネント カンマ区切り(完全一致)

3フェーズ

# Phase 1: エラーのみで障害箇所を特定
LOG_LEVEL=error deno test --allow-env --allow-read --allow-write
# Phase 2: KEYで絞り込み
LOG_LEVEL=debug LOG_KEY=<key> LOG_LENGTH=S deno test --allow-env --allow-read --allow-write
# Phase 3: 特定箇所の全量確認
LOG_LEVEL=debug LOG_KEY=<key> LOG_LENGTH=W deno test --allow-env --allow-read --allow-write tests/<file>_test.ts

KEY検索

grep -rn 'new BreakdownLogger(' --include='*.ts' | grep -oP '"[^"]*"' | sort -u

トラブルシュート

出力なし→LOG_LEVEL確認 / 出力過多→LOG_KEY追加 / 切り詰め→LOG_LENGTH上げる / KEY不明→ソースgrep / モジュール横断→LOG_KEY=key1,key2

ERRORはstderr、他はstdout。2> stderr.logでエラー分離、2>&1 | tee debug.logで全量取得。調査中ロガーはfix-<id>キーで作成し、deno run --allow-read jsr:@tettuan/breakdownlogger/validate .で本番混入を防ぐ。


Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/tettuan--breakdownparams--breakdownlogger-debug-with-logger commit bd825b87e8

Frequently asked questions

npx skillmds@latest add tomevault-io/debug-with-logger