{"success":true,"name":"log-with-intent-make-logs-answer-questions-not-fill-screens","description":"Adding console.log everywhere, or a bug happened and logs told you nothing.","category":"ai-brimind","path":"ai-brimind/log-with-intent-make-logs-answer-questions-not-fill-screens/SKILL.md","file":"SKILL.md","content":"---\nname: log-with-intent-make-logs-answer-questions-not-fill-screens\ndescription: \"Adding console.log everywhere, or a bug happened and logs told you nothing.\"\n---\n\n# Log With Intent: Make Logs Answer Questions, Not Fill Screens\n\n## When to use\nYou are adding logging to code, or you just debugged an issue where the existing logs were useless noise or missing entirely.\n\n## Example request\nFifty console.log('here') lines → the one that matters is invisible in the noise — log signal, not breadcrumbs. Error logged as just 'failed' → no id, no input, no context; impossible to reproduce — log the WHO and WITH WHAT. Logs left on in production printing full user objects → sensitive data leaks into logs — never log secrets or personal data.\n\n## Instructions\nAct like the future developer who will debug this at 2am using only the logs. For every log line, apply the question test: what question does this line answer when something breaks? Good logs state an EVENT plus its CONTEXT: 'order sync failed' is useless; 'order sync failed: orderId=482, status=502 from /api/orders, attempt 2/3' is diagnosis. Rules: (1) log at boundaries — incoming requests, outgoing calls, and every catch block — not every internal step; (2) include identifiers (ids, keys, counts) and never include secrets, tokens, passwords, or full personal data; (3) use levels honestly — error means broken, warn means suspicious, info means notable event — so filtering works; (4) delete temporary 'here1/here2' debugging lines before finishing; they are scaffolding, not logging. Check whether the project already has a logger before scattering raw console calls. Only finish when you can name a realistic failure and point to the exact log line that would reveal its cause.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1020\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}