From debugging
Set up structured JSONL logging in a codebase for both production code and test frameworks (unit tests, integration tests). Supports C#, JavaScript/TypeScript, Python, and Rust. Use when asked to "add logging", "set up structured logging", "enable test logging", "make this debuggable", "add JSONL logging", "configure log output", "instrument this code with logs", "fix unit test logging", "set up test framework logging", "add logging to tests", "replace Console.WriteLine in tests", or "configure xUnit/NUnit/MSTest/Jest/Vitest/pytest logging". NOT for debugging issues (use debug-with-logs) or reviewing logging quality (use logging-review agent).
How this skill is triggered — by the user, by Claude, or both
Slash command
/debugging:logging-enablementThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up structured JSONL logging in a codebase so it's ready for log-first debugging.
reference/csharp/production-logging.mdreference/csharp/test-harness-logging.mdreference/js-ts/production-logging.mdreference/js-ts/test-harness-logging.mdreference/log-render-spec.mdreference/python/production-logging.mdreference/python/test-harness-logging.mdreference/rust/production-logging.mdreference/rust/test-harness-logging.mdSet up structured JSONL logging in a codebase so it's ready for log-first debugging.
Console.WriteLine / print() / console.log() to structured loggingdebug-with-logs skilllogging-review agentScan the codebase to determine:
Primary language(s): Look for project files
.csproj / .sln → C#package.json → JavaScript/TypeScriptpyproject.toml / setup.py / requirements.txt → PythonCargo.toml → RustTest framework(s): Look for test configuration
xunit / NUnit / MSTest references in .csprojjest.config.* / vitest.config.* / .mocharc.*pytest.ini / conftest.py / unittest imports#[cfg(test)] blocks, tests/ directoryExisting logging: Check for current logging setup
Console.Write / print() / console.log usageClassify the codebase into one of:
| State | Description | Action |
|---|---|---|
| No logging | No logging library, uses print/console | Full enablement needed |
| Unstructured logging | Has logging library but text format | Configure JSONL formatter |
| Structured but not JSONL | JSON logging but missing canonical fields | Align field names |
| Already compliant | JSONL with canonical fields | Verify and skip |
Read the appropriate language-specific reference guide:
| Language | Test Harness Guide | Production Guide |
|---|---|---|
| C# | csharp/test-harness-logging.md | csharp/production-logging.md |
| JS/TS | js-ts/test-harness-logging.md | js-ts/production-logging.md |
| Python | python/test-harness-logging.md | python/production-logging.md |
| Rust | rust/test-harness-logging.md | rust/production-logging.md |
For each guide, follow:
source: "client" field to every log entryAfter enablement, verify the logging output is queryable:
-- Verify canonical fields are present
SELECT "@t", "@l", "@logger", "@m"
FROM read_json_auto('app.log.jsonl')
LIMIT 5;
-- Verify test context fields (for test projects)
SELECT "test-case-name", "test-module-name", "@m"
FROM read_json_auto('test-results.log.jsonl')
WHERE "test-case-name" IS NOT NULL
LIMIT 5;
@t is ISO 8601 UTC with sub-second precision@l has correct log level values@m contains rendered messages@logger identifies the source componenttest-case-name and test-module-nameUse whatever the project already uses. If starting fresh, prefer:
| Language | Recommended | Why |
|---|---|---|
| C# | Serilog | Native CompactJsonFormatter produces canonical @t/@l/@m |
| JS/TS | Pino | Fastest, native JSON output, minimal config |
| Python | structlog | Composable processors, clean JSON output |
| Rust | tracing + tracing-subscriber | Ecosystem standard, JSON layer available |
Add logging at decision points — places where the code chooses a path:
if/else, switch)catch, error returns)See log-format-spec.md for the full level guide. Quick rule:
reference/{language}/npx claudepluginhub gautam-achieveai/claudeplugins --plugin debuggingCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.