Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Log NinjaNew to Visual Studio Code? Get it now.
Log Ninja

Log Ninja

VS Code Extension Dev

|
2 installs
| (0) | Free
Generate contextual logging statements for selected variables with a single keyboard shortcut
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Log Ninja

Generate contextual logging statements for selected variables with a single keyboard shortcut. Supports 13+ programming languages with zero configuration.

Quick Start

  1. Select a variable in your code
  2. Press Ctrl+Shift+L (or Cmd+Shift+L on Mac)
  3. A contextual log statement appears below your selection

Features

  • 🎯 Smart Detection: Automatically detects file type and generates appropriate syntax
  • 📍 Contextual Information: Includes file name, line number, and variable name
  • 🌐 Multi-Language Support: Supports 13+ programming languages
  • ⚡ Flexible Selection: Works with selected text or word at cursor position
  • 🚀 Zero Configuration: Works immediately after installation

📋 Supported Languages

Language Log Statement File Extension Example Output
TypeScript console.log .ts console.log('[TS] file.ts:10 - variable:', variable);
JavaScript console.log .js console.log('[JS] file.js:10 - variable:', variable);
Python print .py print(f'[PY] file.py:10 - variable: {variable}')
Java System.out.println .java System.out.println("[JAVA] File.java:10 - variable: " + variable);
C# Console.WriteLine .cs Console.WriteLine($"[CS] File.cs:10 - variable: {variable}");
C++ std::cout .cpp std::cout << "[CPP] file.cpp:10 - variable: " << variable << std::endl;
C printf .c printf("[C] file.c:10 - variable: %s\\n", variable);
Go fmt.Printf .go fmt.Printf("[GO] file.go:10 - variable: %v\\n", variable)
Rust println! .rs println!("[RUST] file.rs:10 - variable: {:?}", variable);
PHP echo .php echo "[PHP] file.php:10 - variable: " . $variable . "\\n";
Ruby puts .rb puts "[RUBY] file.rb:10 - variable: #{variable}"
Kotlin println .kt println("[KOTLIN] file.kt:10 - variable: $variable")
Swift print .swift print("[SWIFT] file.swift:10 - variable: \\(variable)")

Usage

Method 1: Select and Log

  1. Select a variable name in your code
  2. Press Ctrl+Shift+L (Windows/Linux) or Cmd+Shift+L (Mac)
  3. A log statement will be inserted on the next line

Method 2: Cursor and Log

  1. Place your cursor on a variable name
  2. Press Ctrl+Shift+L (Windows/Linux) or Cmd+Shift+L (Mac)
  3. The extension will detect the word at cursor and generate a log statement

Examples

JavaScript:

const userName = "John Doe";
console.log('[JS] example.js:5 - userName:', userName);

Python:

user_name = "John Doe"
print(f'[PY] example.py:5 - user_name: {user_name}')

Keyboard Shortcut

  • Ctrl+Shift+L (Windows/Linux)
  • Cmd+Shift+L (macOS)

Or use Command Palette: Log Ninja: Generate Log Statement

Issues

If you encounter any issues or have feature requests, please file them in the GitHub Issues section.


🥷 Strike swiftly, debug efficiently with Log Ninja! ⚡

Made with ❤️ for developers who love clean, contextual logging

⬆ Back to Top

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft