Openfixx.com

How to Generate Smart Debug Logs Automatically in VS Code

The VS Code Extension That Writes Your Debug Logs For You

IntelliLog detects what kind of variable you’re working with, picks the right logging method for your language, and inserts a perfectly-formatted statement — in one keyboard shortcut. No copy-pasting. No manual file names. No forgotten console.logs left in production.

8Languages
5Commands
1Shortcut to log
0Manual setup

JavaScript
TypeScript
Python
Go
PHP
Dart / Flutter
Ruby
Rust

Install IntelliLog Free →

The Debug Logging Tax Every Developer Pays

You’re three layers deep into a bug. The variable looks right. The function signature is fine. But something is off, and you need to see what’s actually flowing through at runtime. So you write a console.log. Or a print(). Or a fmt.Printf. Then you realize you forgot to include the file name, so you add it manually. Then you open the terminal and squint at a wall of output trying to find the one line you just added. Then, an hour later, you forget to remove it before committing.

This happens to every developer, every day. It’s not a skill issue — it’s friction built into the workflow. IntelliLog removes that friction entirely.

The real cost

If you spend just 10 minutes per day adding and cleaning up debug logs — a conservative estimate — that’s 40 hours a year on pure boilerplate. IntelliLog brings that number close to zero.

What Is IntelliLog?

IntelliLog is a free Visual Studio Code extension that automatically generates intelligent, context-aware logging statements. You highlight a variable name, press a keyboard shortcut, and IntelliLog:

  • Detects which programming language you’re using
  • Uses VS Code’s hover API to infer the variable’s type
  • Picks the most appropriate logging method for that type
  • Inserts a formatted log statement below your current line — with the file name, line number, and a trackable marker

That trackable marker is the secret weapon. Every log IntelliLog creates ends with a // intellilog comment (or # intellilog in Python and Ruby). When you’re done debugging, one more shortcut deletes every single one of them — without touching any of your actual code.

8 Languages

JavaScript, TypeScript, Python, Go, PHP, Dart, Ruby, and Rust — all with language-appropriate logging methods.

Smart Type Detection

Arrays get console.table, errors get console.error, promises get console.warn — automatically.

One-Shot Cleanup

Comment, uncomment, or delete every IntelliLog statement in your file with a single keyboard shortcut.

Function Entry Logs

Place your cursor on any function definition and wrap it with an entry log that captures all parameters.

Structured JSON Mode

Output logs as structured JSON for Datadog, Splunk, or CloudWatch — toggle with one setting.

Gutter Decorations

A subtle gutter icon marks every IntelliLog line so you can spot your debug statements at a glance.

How IntelliLog Works

Every time you press the smart-log shortcut, IntelliLog runs through five steps in a fraction of a second:

1

Select Variable

Highlight any variable name in your editor (or use multi-selection for multiple vars at once)

2

Detect Language

IntelliLog reads VS Code’s active language ID and routes to the right language provider

3

Infer Type

VS Code’s hover provider API is queried for the variable’s type signature

4

Pick Log Method

Type info + variable name heuristics choose the best logging call for the situation

5

Insert & Track

The statement is inserted below the selection, tagged with // intellilog for later cleanup

The Marker System

IntelliLog’s marker system is what makes mass cleanup possible. Every generated log ends with a comment that serves as a unique tag:

  • JavaScript / TypeScript / Go / PHP / Rust / Dart: // intellilog
  • Python / Ruby: # intellilog

IntelliLog uses this marker to identify exactly which lines it created — so when you run “Delete All Logs,” it only removes the lines it added and leaves your actual code completely untouched.

The Provider Architecture

Each supported language has its own “provider” — a module that implements a buildLogStatement() function. This function receives the selected text, the hover type information, the indentation, and the current config, and returns the correctly-formatted log string for that language.

All Commands & Keyboard Shortcuts

IntelliLog registers five commands. Four of them have keyboard shortcuts out of the box. The fifth is always accessible via the Command Palette — press Cmd Shift P on Mac or Ctrl Shift P on Windows, then type “IntelliLog”.

Command Mac Windows / Linux What It Does
Smart Insert Log ++L Ctrl+Alt+L Inserts a type-aware log statement below the selected variable. Supports multi-selection.
Wrap Function ++W Ctrl+Alt+W Detects the function on your current line and inserts an entry log with all parameters at the top of the function body.
Comment All Logs ++/ Ctrl+Alt+/ Comments out every IntelliLog-generated line in the active file, preserving indentation.
Uncomment All Logs Command Palette only (search “IntelliLog”) Re-enables all previously commented IntelliLog lines.
Delete All Logs ++D Ctrl+Alt+D Permanently deletes every IntelliLog-generated line. Your real code stays untouched.
Pro tip

Click the status bar item at the bottom of VS Code (it shows “🎯 N logs” when logs exist) to open the Command Palette pre-filtered to IntelliLog commands.

Language-by-Language Examples

IntelliLog has a dedicated provider for each supported language. Each provider knows which logging method fits which data type, how to format the output string, and how to correctly indent the inserted line.

JavaScript TypeScript  / React & JSX included

auth.tsTypeScript

// Select "userId" → press Cmd+Alt+L (Mac) or Ctrl+Alt+L (Windows)

const userId = await getAuthenticatedUserId();
console.log('🎯 [auth.ts:4] userId:', userId); // intellilog

// Multi-select "userId, email, role" → logs all three at once

const { userId, email, role } = await getSession();
console.log('🎯 [auth.ts:8] userId, email, role:', { userId, email, role }); // intellilog

Python

user_service.pyPython

# Select "user_data" → press Cmd+Alt+L

user_data = fetch_user(user_id)
print(f"🎯 [user_service.py:4] {user_data=}") # intellilog

# For a dict/list, IntelliLog uses pprint for readability:
user_list: list[dict] = get_all_users()
pprint.pprint(user_list) # intellilog

# For exceptions, you get full traceback:
except Exception as exc:
    traceback.print_exc() # intellilog

Go

handler.goGo

// Struct → %+v shows field names
userData := fetchUser(id)
fmt.Printf("🎯 [handler.go:12] userData: %+v\n", userData) // intellilog

// Error → log.Printf with %v
err := db.QueryRow(query).Scan(&result)
log.Printf("🎯 [handler.go:16] err: %v\n", err) // intellilog

PHP

UserController.phpPHP

$dbError = $pdo->errorInfo();
error_log("🎯 [UserController.php:18] dbError: " . print_r($dbError, true)); // intellilog

$users = $db->fetchAll(PDO::FETCH_ASSOC);
error_log("🎯 [UserController.php:22] users: " . print_r($users, true)); // intellilog

Dart / Flutter

user_repository.dartDart

final UserModel userData = await fetchUser(userId);
debugPrint('🎯 [user_repository.dart:14] userData: $userData'); // intellilog

// Map → pretty JSON output
final Map<String, dynamic> payload = response.data;
debugPrint('🎯 [user_repository.dart:18] payload: ' + const JsonEncoder.withIndent('  ').convert(payload)); // intellilog

Ruby

user_service.rbRuby

user_data = User.find(user_id)
puts "🎯 [user_service.rb:5] user_data: #{user_data.inspect}" # intellilog

response_payload = { status: 200, data: users }
puts "🎯 [user_service.rb:9] response_payload: #{JSON.pretty_generate(response_payload)}" # intellilog

Rust

main.rsRust

let user_data: User = fetch_user(user_id);
println!("🎯 [main.rs:8] user_data: {:?}", user_data); // intellilog

// Struct/Config → {:#?} pretty-prints nested structs
let config: AppConfig = load_config();
println!("🎯 [main.rs:12] config: {:#?}", config); // intellilog

// Error/Result → eprintln! to stderr (idiomatic Rust)
let err: std::io::Error = parse_file(path).unwrap_err();
eprintln!("🎯 [main.rs:16] err: {:?}", err); // intellilog

Smart Type Detection in JavaScript & TypeScript

Rather than always inserting console.log, IntelliLog picks from ten different console methods based on the variable’s inferred type and name. Here’s the full mapping:

Array / User[]
console.table()
Trigger: type contains [], Array<, or Record<
Error / err
console.error()
Trigger: type contains Error, or name contains err
Promise<T>
console.warn()
Trigger: type contains Promise<
stack / trace
console.trace()
Trigger: name contains trace or stack
queryTime / perf
console.time() + timeEnd()
Trigger: name contains time, perf, or duration
object / dir
console.dir()
Trigger: name contains obj or dir
click / count
console.count()
Trigger: name contains count or click
Everything else
console.log()
Clean, labeled log with file name and line number

dashboard.tsSmart detection in action

// 1. Array → console.table
const users: User[] = await fetchAllUsers();
console.table(users); // intellilog

// 2. Error → console.error
const err = new Error('Payment gateway timeout');
console.error('🎯 [dashboard.ts:8] err:', err); // intellilog

// 3. Promise → console.warn
const analyticsPromise = loadAnalytics();
console.warn('🎯 [dashboard.ts:12] analyticsPromise:', analyticsPromise); // intellilog

// 4. Performance → console.time + console.timeEnd
const queryDuration = Date.now();
console.time('🎯 [dashboard.ts:16] queryDuration'); // intellilog
console.timeEnd('🎯 [dashboard.ts:16] queryDuration'); // intellilog

Function Entry Logging with Wrap Function

The Wrap Function command ( + + W on Mac, Ctrl + Alt + W on Windows) solves a specific debugging scenario: you want to know what arguments are arriving at a function entry point. Place your cursor anywhere on a function definition line and press the shortcut — IntelliLog detects the function name, extracts all parameters, and inserts a single entry log at the top of the function body.

payments.tsBefore & After

// BEFORE — cursor is on line 5, press Cmd+Alt+W

async function processPayment(userId: string, amount: number, currency: string) {
  const result = await gateway.charge({ userId, amount, currency });
  return result;
}

// AFTER — IntelliLog inserts the entry log automatically

async function processPayment(userId: string, amount: number, currency: string) {
  console.log('🎯 [payments.ts:5] processPayment() →', { userId, amount, currency }); // intellilog
  const result = await gateway.charge({ userId, amount, currency });
  return result;
}

user_service.pyPython — self filtered out automatically

def create_user(self, username: str, email: str, role: str = "viewer"):
    print(f"🎯 [user_service.py:8] create_user() → username={username}, email={email}, role={role}") # intellilog
    return User.create(username=username, email=email, role=role)

What IntelliLog detects

Function detection works on standard declarations, arrow functions, class methods, async functions, Go functions with receivers, Rust functions with generics, Python def with type hints, PHP methods, Dart static/async methods, and Ruby def declarations.

Managing Your Logs — Comment, Uncomment, Delete

Every log IntelliLog generates ends with a // intellilog or # intellilog marker. That marker drives three powerful cleanup commands:

Comment All Logs — ++/

Temporarily disables every IntelliLog log statement by prepending // or #. Use this when you want to test behavior without logging but aren’t ready to delete your debug setup.

Uncomment All Logs — Command Palette

Reverses the comment operation, restoring all log statements to active state. Search “IntelliLog: Uncomment” in the Command Palette.

Delete All Logs — ++D

Permanently removes every IntelliLog-generated line. One shortcut, zero traces. Run this before committing. IntelliLog only touches lines that carry the // intellilog marker, so it literally cannot delete code you wrote by hand.

Recommended workflow

Debug freely with IntelliLog → press ++D when done → commit clean code. No pre-commit hook needed for log cleanup.

Structured JSON Mode for Log Aggregators

If your team uses Datadog, Splunk, or AWS CloudWatch, enable intellilog.structuredOutput in your VS Code settings. IntelliLog will generate JSON.stringify output (JS/TS) or json.dumps (Python) with a _src field pointing to the exact file and line.

order.tsStructured JSON output

const orderData = await fetchOrder(orderId);
console.log(JSON.stringify({ _src: '[order.ts:8]', orderData: orderData }, null, 2)); // intellilog

Configuration Options

IntelliLog works out of the box with zero configuration. Three settings are available under + , → search “IntelliLog”:

Setting Type Default Description
intellilog.logPrefix string “🎯” Emoji or text prepended to every log. Set to empty string to remove it.
intellilog.insertArrow boolean true When true, inserts a colon after the variable name label in the log string.
intellilog.structuredOutput boolean false Outputs logs as JSON.stringify / json.dumps for log aggregators. Supported in JS/TS and Python.

Who Should Use IntelliLog?

Full-Stack Developer

Working Across Multiple Languages

You write TypeScript on the frontend and Python or Go on the backend. IntelliLog handles each language’s conventions automatically.

Flutter / Dart Developer

Debugging Widget State

IntelliLog knows that BuildContext needs debugPrint with .runtimeType, and Maps need pretty JSON. Flutter-specific knowledge baked in.

Backend Engineer

Tracing API and DB Requests

The function wrap command puts all function parameters into a single entry log — exactly what you need for request tracing.

DevOps / Platform Engineer

Working with Log Aggregators

Enable structuredOutput mode and your debug logs become JSON documents that Datadog or Splunk can parse automatically.

Why IntelliLog Matters

The case for IntelliLog isn’t just about saving time — it’s about the kind of debugging you do when logging is frictionless versus when it’s annoying. When logging is annoying, you log less. You make assumptions. You guess. That’s when bugs get harder to find, not easier.

When logging is a single keyboard shortcut, you check the value. You verify the type. You confirm the function is actually being called with the arguments you expect. And because IntelliLog labels everything with the file name and line number automatically, you can actually find your logs in the output.

In a team environment, IntelliLog creates consistent log formatting across everyone’s debug output. Every log your whole team produces follows the same 🎯 [filename:line] varName: value pattern — so when someone pastes terminal output into Slack for help, everyone can read it immediately.

And since every IntelliLog-generated line ends with // intellilog, you can grep for it in CI if you want a strict “no debug logs in PRs” policy. The marker is machine-readable.

Getting Started with IntelliLog

Install from the VS Code Marketplace

Open VS Code, press +Shift+X to open Extensions, search for “IntelliLog”, and click Install.

Open any supported file

IntelliLog activates automatically for JS, TS, Python, Go, PHP, Dart, Ruby, and Rust files. No project setup needed.

Select a variable and press the shortcut

Highlight any variable name, then press ++L (Mac) or Ctrl+Alt+L (Windows). A log appears on the next line immediately.

Debug freely, then clean up

When done, press ++D (Mac) or Ctrl+Alt+D (Windows) to delete every IntelliLog statement. Then commit clean code.

Install IntelliLog Free on VS Code Marketplace →

Free. No account needed. Works offline.

IntelliLog — Smart debug logging for VS Code — Supports JavaScript, TypeScript, Python, Go, PHP, Dart, Ruby, Rust

Free and open source. No telemetry. No accounts.

Leave a Reply

Your email address will not be published. Required fields are marked *