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.

Install DevSnip Pro — freeRead the docs

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:

TypeScript
console.log('[cart.ts:14] total:', total);
Python, with a logging logger in the file
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.d on Android, debugPrint in Flutter and os.Logger in Swift. Otherwise it falls back to console.log, print, System.out.println or Console.WriteLine. It works with several cursors.

Clean Debug Logs

  • Finds console.log, print, System.out.println, Console.WriteLine, debugPrint and 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.consoleLogCleanup.confirmBeforeDelete). Remove Debug Logs in This File does the same for the open editor, and Undo reverts it.

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.json and extensions.json. Your existing configurations are kept.
  • 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

Search all the developer tools →

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.

Try it in your own editor

Free, no account, runs locally. Requires VS Code 1.93+ on Windows, macOS or Linux.

code --install-extension sayaib.hue-console