Stop wasting time writing repetitive logging statements. Generate contextual logs instantly with a single keystroke.
TL;DR
π₯· Log Ninja is a VS Code extension that generates contextual logging statements with a single keystroke (Ctrl+Shift+L).
β¨ What it does: Select a variable β Press shortcut β Get perfectly formatted logs with file name, line number, and context.
π Languages: JavaScript, TypeScript, Python, Java, C#, C++, Go, Rust, PHP, Ruby, Kotlin, Swift, and more.
β‘ Why it's different: Zero configuration, multi-language support, contextual intelligence (unlike basic snippets).
π Perfect for: Debugging complex apps, full-stack development, team consistency.
π¦ Installation: Search "Log Ninja" in VS Code Extensions β Install β Start using immediately.
π Open Source: v0.0.1 - contributions welcome!
The Problem Every Developer Faces
We've all been there. You're deep in debugging mode, trying to trace a bug, and you find yourself typing the same logging statements over and over:
console.log('userName:', userName);
console.log('userAge:', userAge);
console.log('isActive:', isActive);
After the 20th time writing similar statements, you start asking yourself: "There has to be a better way, right?"
What Makes Debug Logging Frustrating?
-
Repetitive Typing: Writing
console.log,print(), orSystem.out.printlnrepeatedly - Context Loss: Forgetting which file and line the log came from
- Inconsistent Format: Different developers use different logging styles
- Time Consuming: Breaking focus to write logging statements
- Multi-Language Hassle: Switching between projects with different languages means remembering different syntax
Enter Log Ninja: Silent, Swift, and Smart
Log Ninja is a VS Code extension that solves all these problems with a single keyboard shortcut. Select a variable, press Ctrl+Shift+L, and watch contextual logging magic happen.
What Makes Log Ninja Different?
π― Contextual Intelligence
Unlike basic snippet extensions, Log Ninja doesn't just insert textβit understands your context:
// Before: Your cursor is on 'userName' at line 15 in auth.js
const userName = "john_doe";
// After: Press Ctrl+Shift+L
const userName = "john_doe";
console.log('[JS] auth.js:15 - userName:', userName);
The generated log includes:
-
File type (
[JS]for JavaScript) -
File name (
auth.js) -
Line number (
15) -
Variable name (
userName)
π True Multi-Language Support
Most logging extensions focus on one language. Log Ninja supports 13+ languages with language-specific syntax:
JavaScript/TypeScript:
console.log('[JS] file.js:10 - variable:', variable);
Python:
print(f'[PY] file.py:10 - variable: {variable}')
Java:
System.out.println("[JAVA] File.java:10 - variable: " + variable);
C#:
Console.WriteLine($"[CS] File.cs:10 - variable: {variable}");
Go:
fmt.Printf("[GO] file.go:10 - variable: %v\n", variable)
β‘ Zero Configuration
No setup required. Install and start using immediately. No JSON configurations, no custom templates to defineβit just works.
πͺ Flexible Selection
Works in two ways:
- Select text and press the shortcut
- Place cursor on a variable and press the shortcut (auto-detects word boundaries)
Comparison with Existing Solutions
vs. Manual Typing
- β Manual: 15-30 seconds per log statement
- β Log Ninja: 1 second with keyboard shortcut
vs. Basic Snippets
- β Basic Snippets: Generic templates, no context
- β Log Ninja: File-aware, line-aware, language-specific
vs. Language-Specific Extensions
- β Single Language: Only works for one programming language
- β Log Ninja: Works across 13+ languages in the same project
vs. Complex Logging Frameworks
- β Complex Tools: Require configuration, setup, learning curve
- β Log Ninja: Zero configuration, instant productivity
Real-World Impact
Before Log Ninja:
β° Time to add debug logs: 5-10 minutes for 20 statements
π§ Mental overhead: High (syntax, formatting, context)
π Consistency: Low across team members
π Multi-language projects: Painful context switching
After Log Ninja:
β° Time to add debug logs: 30 seconds for 20 statements
π§ Mental overhead: None (muscle memory)
π Consistency: Perfect across entire team
π Multi-language projects: Seamless experience
Perfect for These Scenarios
π Debugging Complex Applications
When you need to trace data flow through multiple functions and files:
// Quickly add logs throughout your application
const processUser = (userData) => {
console.log('[JS] userService.js:23 - userData:', userData);
const validation = validateUser(userData);
console.log('[JS] userService.js:26 - validation:', validation);
const result = saveUser(userData);
console.log('[JS] userService.js:29 - result:', result);
return result;
};
ποΈ Full-Stack Development
Working with multiple languages in the same project:
# Python backend
def get_user_data(user_id):
print(f'[PY] api.py:15 - user_id: {user_id}')
return database.get_user(user_id)
// JavaScript frontend
const fetchUser = async (userId) => {
console.log('[JS] userApi.js:8 - userId:', userId);
const response = await fetch(`/api/users/${userId}`);
return response.json();
};
π₯ Team Development
Ensuring consistent logging format across team members:
- Everyone uses the same contextual format
- Quick identification of log sources during debugging
Installation and Usage
Quick Setup
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for "Log Ninja"
- Click Install
Usage
- Select a variable in your code
-
Press
Ctrl+Shift+L(orCmd+Shift+Lon Mac) - Done! Contextual log statement appears
Alternative Method
- Place cursor on a variable (no selection needed)
- Press
Ctrl+Shift+L - Log Ninja auto-detects the variable name
Supported Languages
JavaScript, TypeScript, Python, Java, C#, C++, C, Go, Rust, PHP, Ruby, Kotlin, Swift
More languages coming based on community feedback!
The Developer Experience Transformation
Before:
1. Think about log syntax for current language
2. Type console.log/print/System.out.println
3. Add variable name
4. Remember to include context manually
5. Repeat 50 times per debugging session
6. End up with inconsistent log formats
After:
1. Select variable
2. Ctrl+Shift+L
3. Continue coding
4. Perfect contextual logs everywhere
Community and Future
Log Ninja is open source and actively maintained. The roadmap includes:
- π¨ Customizable log formats
- π Additional language support
- π§ User-defined templates
- π Log level configuration
π This is Just the Beginning!
Log Ninja v0.0.1 is the first release, and this is where the community comes in! As an open-source project, Log Ninja thrives on developer feedback and contributions.
π¬ Your Voice Matters
- Found a bug? Report it on GitHub Issues
- Missing a language? Let us know which one you need
- Have ideas for better log formats? Share your suggestions
- Want custom templates? Tell us your use cases
π€ Join the Development
- Contribute code: The codebase is TypeScript-friendly and well-documented
- Add language support: Help us support more programming languages
- Improve features: Enhance existing functionality
- Write documentation: Help other developers discover Log Ninja
π How to Contribute
- Star the repository to show your support
- Open issues for bugs or feature requests
- Submit pull requests for improvements
- Share feedback in the comments below
The goal is to make Log Ninja the ultimate debugging companion for every developer, and that can only happen with community input!
Why Choose Log Ninja?
β For Individual Developers
- Massive time savings
- Reduced cognitive load
- Consistent debugging experience
- Works across all your projects
β For Teams
- Standardized logging format
- Easier log analysis
- Improved debugging efficiency
- Zero onboarding time
β For Multi-Language Projects
- Single tool for all languages
- Consistent experience everywhere
- No context switching overhead
Try It Today
Stop writing repetitive logging statements. Start debugging efficiently with Log Ninja.
Install Log Ninja from VS Code Marketplace β
Tags
#vscode #debugging #productivity #javascript #python #typescript #webdev #tools #extension #logging #development #coding
Have you tried Log Ninja? Share your experience in the comments below! What's your biggest debugging pain point that you'd like to see solved? As this is the first version (v0.0.1), your feedback will directly shape the future of Log Ninja!
GitHub Repository: https://github.com/Rakeshgombi/log-ninja
Contribute: Issues, PRs, and suggestions are always welcome! π
About the Author
Building developer tools that solve real problems. Follow me for more VS Code extensions and productivity tips!
Top comments (0)