Fast, safe, beautiful, and fully customizable to log your 🐞.
Console:
Variable navigator: Using Ctrl + click in path to navigate to variable definition
| Feature | Description |
|---|---|
| Variable navigator | No selection needed — just place cursor on a variable and press F6. |
Multi-log with Ctrl+D |
Ctrl+D to add matches → F6 → logs all instances. |
| Smart JSON serialization | Objects →JsonSerializer.Serialize(...) with Indented/SingleLine. |
| Custom log template | Use {prefix}, {type}, {varLine}, {pathLine}, {timeLine}. |
| ANSI-colored console | DEBUG (cyan), INFO (green), ERROR (red) — toggleable. |
| Auto-format & indent | Code stays clean and consistent. |
| Toggle generated logs | Ctrl+F6 → comment/uncomment all logs from this extension. |
| 100% safe insertion | Never breaks {, if, foreach, catch, etc. |
- Open Extensions (
Ctrl+Shift+X) - Search:
LogCSharpVariable - Click Install
code --install-extension logcsharpvariable-1.0.0.vsix- Select a variable → press
F6 - Pick log level:
DEBUG/INFO/ERROR - Log is inserted, formatted, and colored in integrated terminal
- Cursor on first occurrence → press
Ctrl+Dto select next (*) - Press
F6→ logs all selected matches
(*) If your IDE not set yet, find
Add Selection to Next find matchin keyboard setting
- Press
Ctrl+F6→ enable/disable all generated logs
| Shortcut | Action |
|---|---|
F6 |
Log variable under cursor |
Ctrl+F6 |
Toggle Generated Log |
Ctrl+Shift+P → Log C# Variable: 💫Go to Settings |
Access extension settings |
{prefix}{type}
{varLine}
{timeLine} at {pathLine}
Result:
[APP][ERROR]
st = {
"Name": "John Doe",
"Age": 20
}
2025-11-05 16:21:29 at d:/coding/vscode-ext/test-vscode-csharp/TestConsoleLog/Program.cs(8,1)
| Command | Description |
|---|---|
LogCSharpVariable: Log Variable |
F6 |
LogCSharpVariable: Toggle Generated Log |
Ctrl+F6 |
- VS Code:
^1.96.2 - Language: C# (
.csfiles) - .NET:
^6.0(forSystem.Text.Json)
Bug? Feature request? GitHub Repository
git clone https://github.com/alexnguyen03/Log-Csharp-Variable.git
cd Log-Csharp-Variable
code .Love Log CSharp Variable? Help keep it alive!
Your support funds:
- New features (ILogger, Serilog, Blazor)
- Bug fixes & performance
- Docs & tutorials
Have a question, suggestion, or just want to say hi?
| Platform | Link |
|---|---|
| nguyenhoainam121n@gmail.com | |
| GitHub | @alexnguyen03 |
| Nam Nguyen |
MIT License © 2025 Alex Nguyen
Happy debugging!

