You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[vscode-extension] Logging events in logfile (#1745)
## Summary
Added capability to log sequence of events and potential errors in
"Re-open in devbox shell environment" functionality of the extension.
This involved adding a log file in `.devbox/extension.log` file which
both the vscode extension process and devbox binary will output their
logs into.
The reason to add this capability is "Re-open in devbox shell"
functionality relies on multiple sub-processes running a sequence of
events correctly. So if one breaks along the way, often times, the error
message for it will be lost. This PR makes sure that in such cases, the
user has a way of capturing the error messages that may have been lost.
## How was it tested?
1. in devbox, run: `devbox run build` this creates a binary in
`dist/devbox` copy the absolute path to that binary
2. in an editor, edit the file `/usr/local/bin/devbox` in line 414 to be
similar to below:
```bash
#local -r bin="${INSTALL_DIR}/${version}_${platform}/${TOOL_NAME}"
# absolute path to devbox binary in dist/
local -r bin="/Users/mohsenansari/code/jetpack/go.jetpack.io/devbox/dist/devbox"
```
3. Back in devbox repo in Terminal `cd vscode-extension` then run `vsce
package` (if you don't have vsce install do it via `npm i -g vsce`
4. Open vscode and uninstall the already installed devbox extension.
Then reload vscode.
5. In Terminal, run `code --install-extension devbox-0.1.3.vsix`
6. In VSCode go to settings(UI) and search for devbox. Enable debug mode
by ticking its checkbox.
7. cmd + shift + p and search for "Devbox: Re-open in Devbox shell
environment"
8. Confirm an `extension.log` file is created in `.devbox/` directory
and contains the logs for reopen in devbox feature.
Copy file name to clipboardExpand all lines: vscode-extension/package.json
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,11 @@
128
128
"type": "boolean",
129
129
"default": true,
130
130
"description": "Automatically run devbox shell when terminal is opened."
131
+
},
132
+
"devbox.enableDebugMode": {
133
+
"type": "boolean",
134
+
"default": false,
135
+
"description": "Enables debug mode for this extension which creates an extension.log in .devbox/ directory. Currently only works for 'Devbox: Reopen in Devbox shell environment' command."
0 commit comments