Skip to content
Back to skills

Add Logging

ASecurity

Add strategic temporary logging to isolate an issue, read the output, then remove it cleanly

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
ai-agentsgodebugging

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill add-logging --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Logging?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Logging
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-add-logging/badge)](https://www.skillsdirectory.com/skills/black141312-add-logging)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-logging
description: Add strategic temporary logging to isolate an issue, read the output, then remove it cleanly
category: debugging
---

# Add Logging

Reach for this when you can't see what the code is doing and a debugger isn't practical (async flows, production-like runs, fast loops). Logging buys visibility — but it's scaffolding, not a deliverable.

1. Decide what you need to confirm: which branch was taken, what a value is, whether a function ran, or how long something took.
2. Place logs at decision points and boundaries — function entry/exit, before/after the suspect call, inside each branch of the `if`.
3. Log identifying context with each value: a label, the variable name, and a correlation id if multiple requests interleave.
4. Run the repro, read the output, and narrow: each pass should let you delete some logs and add more around the surviving suspect.
5. Once the root cause is confirmed, apply the fix.
6. Remove every temporary log (grep for your unique marker), and re-run to confirm the fix holds without them.

## Rules
- Tag temporary logs with a unique searchable string (e.g. `XDEBUG`) so you can find and delete all of them.
- Log values, not just "got here" — `console.log('count', count)` beats `console.log('here')`.
- For loops or hot paths, gate logging or log only the boundary case so output stays readable.
- Don't commit debug logs; if a log is genuinely worth keeping, promote it to a real logger at the right level deliberately.
- Beware that logging can mask timing bugs — see the fix-flaky-tests skill if the bug vanishes once logs are added.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…