Alchemy logging vscode extension provides a capability to automatically generate, suggest / insert log code as used by alchemy-logging library.
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
- After typing
log.<level>("
(where<level>
refers to log level), presscmd+shift+a
for mac andctrl+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.
- 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
- Provides easy way of generating 6 digit log code along with log-level suffix on pressing
cmd+shift+a
for mac andctrl+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
coming soon.
coming soon.
coming soon.
- 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
- Open command menu:
Cmd+shift+p
- Select
Extension: Install Extensions
- Search for
Alchemy logging
- Click on
Install
- 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. - Enjoy extension!
Refer to change logs
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
- Package and Publishing: https://code.visualstudio.com/api/working-with-extensions/publishing-extension
Enjoy!