Debug & cleanup
Language-aware debug logs and cleanup for VS Code
Log a variable with its file and line in one keystroke, using the logger the file already has. When the bug is fixed, remove every leftover log across the workspace without touching your real logging. Works in JavaScript, TypeScript, Python, Java, Kotlin, C#, Dart and Swift.
On this page 5 sections
Insert Debug Log
Put the cursor on a variable and press Ctrl+Alt+Shift+L (or right-click). The log goes where the value exists — after the assignment, at the top of a function for a parameter, at the top of a loop for its variable — and is labelled with the file and line:
console.log('[cart.ts:14] total:', total);logger.debug("[orders.py:12] total=%r", total)It uses the logger the file already has: logging in Python, SLF4J or Lombok log in Spring Boot, ILogger in ASP.NET Core, Log. on Android, debugPrint in Flutter and os. in Swift. Otherwise it falls back to console., print, System. or Console.. It works with several cursors.
Clean Debug Logs
- Finds
console.,log print,System.,out. println Console.,WriteLine debugPrintand similar calls across the workspace, including<script>blocks in HTML, Vue, Svelte and PHP. - Ignores calls inside comments and strings, and removes only statements that stand alone on their lines; anything else is listed for you to review.
- Keeps code valid: a Python block left empty gets
pass. - Asks before deleting (
devsnip.). Remove Debug Logs in This File does the same for the open editor, and Undo reverts it.consoleLogCleanup. confirmBeforeDelete
Run & Debug and tidy-up
- Run & Debug Configurations detects Next.js, Vite, Angular, NestJS, Node.js, React Native, Expo, FastAPI, Django, Flask, Spring Boot, ASP.NET Core, .NET and Flutter projects, including monorepos, and writes
launch.,json tasks.andjson extensions.. Your existing configurations are kept.json - Remove Unused Imports for JavaScript, TypeScript, Python, Java and Kotlin.
- Unused Dependencies lists npm, Python and Flutter/Dart packages nothing uses, with the command to remove them.
- Build Error Explainer and Log Analyzer & Formatter for reading what went wrong.
Tools in this area
Testing & Debugging 8 tools
- Insert Debug Log
- Clean Debug Logs
- Run & Debug Configurations
- Build Error Explainer
- Log Analyzer & Formatter
- Mock Data Generator
- JSON Schema Validator
- Port & Network Toolkit
Questions
- Will Clean Debug Logs remove my real logging?
- No. It removes print-style debug calls and the logs Insert Debug Log wrote (recognised by their [file:line] label). Calls through your project logger that it did not write are left alone.
- Which languages are supported?
- JavaScript, TypeScript, Python, Java, Kotlin, C#, Dart and Swift.