This is an extension for Visual Studio Code that provides a quick and convenient way to insert and delete log statements in your code. The extension supports multiple languages including C#, Python, ShellScript, JavaScript, TypeScript, C++, C, and Rust.
- Insert log statements for the word under the cursor
- Insert log statements for highlighted text
- Delete all log statements in the current document
- Customizable log statements for each supported language
-
Install the extension
-
Open a document in one of the supported languages
-
To insert a log statement for the "word" under the cursor:
- Press
Ctrl/Cmd+Shift+L
- Or press
Ctrl/Cmd+Shift+P
and runInsert Log Statement
- Press
-
To insert a log statement for longer text, highlight the text and:
- Press
Ctrl/Cmd+Shift+L
- Or press
Ctrl/Cmd+Shift+P
and runInsert Log Statement
- Press
-
The log statement for a specific language can be customized via Settings:
{var}
represents the variable name that will be logged- Either open the UI settings for the extension and modify the Log String for the language you want to customize.
- Or open the settings editor and add
"quickLogUtil.languageLogString": "yourcustomstring"
where language is the language you want to customize (e.g."consoleLogUtils.csharpLogToInsert": "Console.WriteLine($\"{var}: {{var}}\");"
)
The extension provides the following settings:
quickLogUtil.unityLogString
: Custom log statement for Unity C# projectsquickLogUtil.csharpLogString
: Custom log statement for C# projectsquickLogUtil.pythonLogString
: Custom log statement for Python projectsquickLogUtil.shellscriptLogString
: Custom log statement for ShellScript projectsquickLogUtil.javascriptLogString
: Custom log statement for JavaScript/TypeScript projectsquickLogUtil.cppLogString
: Custom log statement for C++ projectsquickLogUtil.cLogString
: Custom log statement for C projectsquickLogUtil.rustLogString
: Custom log statement for Rust projects
None at the moment.
1.0.0 Initial release of Quick Log Util
If you have any questions or issues, please open an issue on the Github repository
Feel free to submit pull requests or issues on the Github repository
This extension is licensed under the MIT license.