Alchemy logging vscode extension provides a capability to automatically generate, suggest / insert log code as used by alchemy-logging library.
Usage
Configuring log prefix
cmd+shift+p (open command palate for vscode)
Select Configure Alog Code Generator
Add 3 character log code prefix. NOTE: if the length is not 3 characters, the configurator will not accept
This configuration is per workspace. So, for every project, this would need to be done separately
Without this configuration. alog-code-generator will use default, i.e $UNK$ as the prefix
Using code generation
After typing log.<level>(" (where <level> refers to log level), press cmd+shift+a for mac and ctrl+shift+a for windows/linux system
This will automatically complete the log code along with the level suffix. (Check features, section below)
NOTE: This will also add prefix, if not entered by the user already. The prefix here refers to the 3 char library prefix that is standard convention in alog. If the log prefix is not configured, the log auto-completion will use $UNK$ as the prefix.
Using auto complete feature
After typing usual log line, start your log code with < character. This will trigger auto-completion and extension will propose a log code with suffix
For selecting the log code, simply press Enter
Features
Provides easy way of generating 6 digit log code along with log-level suffix on pressing cmd+shift+a for mac and ctrl+shift+a for windows/linux systems.
Based on the line being written, alog code generator automatically figures out the level of the log code and assigns suffix to the log code. For example:
log.info -> I
error.type_check -> E
log.error -> E
Allow workspace level configuration of log code prefix using vscode command palate
Provide auto complete suggestion for the log code, triggered by < character when writing the log line
Requirements
coming soon.
Extension Settings
coming soon.
Known Issues
coming soon.
Release process
Local
Install npm install -g vsce
vsce, short for "Visual Studio Code Extensions", is a command-line tool for packaging, publishing and managing VS Code extensions.
Go to root directory of the extension: cd alog-extension
Install package and depdendencies: npm install
Create extension package: vsce package
Installation
Extension Marketplace
Open command menu: Cmd+shift+p
Select Extension: Install Extensions
Search for Alchemy logging
Click on Install
Local Build
Open command menu: Cmd+shift+p
Select Extension: Install Extensions
On the left hand side extension panel, click on three horizontal dots, ...
Select Install from VSIX
Find path to above generated .vsix file and install the package.