Issue |
146880
|
Summary |
LLDB-DAP extension should provide better logging to diagnose issues
|
Labels |
new issue
|
Assignees |
|
Reporter |
award999
|
While trying to diagnose debugging issues experienced by users of the [vscode-swift](https://github.com/swiftlang/vscode-swift) extension, I have been finding it hard to get sufficient information and logging to diagnose issues with the LLDB-DAP extension. I would like to propose the following setup which I have found worked well in other extensions I've worked on:
1. Have an `LLDB-DAP` [OutputChannel](https://code.visualstudio.com/api/references/vscode-api#OutputChannel) where users can view some messaging provided by the extension to possibly diagnose their own problems.
2. On activate the provided [ExtensionContext](https://code.visualstudio.com/api/references/vscode-api#ExtensionContext) has a `logUri` property where VSCode wants the extension to write log files. There is a timestamped folder so you can find logs for older sessions.
3. [winston](https://github.com/winstonjs/winston) is a popular MIT module for handling logging. The great thing about winston is you can [add multiple transports](https://github.com/winstonjs/winston?tab=readme-ov-file#adding-custom-transports). So you have one common logging interface but winston handles the writing to the multiple data sinks.
4. Add a transport the writes to the `OutputChannel`. By default the `OutputChannel` transport will have log level `info`
5. A log file transport will be added to write a log file under the `logUri` folder, and this log will be at the `debug` log level. So the log file captures everything to help with diagnosing issues, but the `OutputChannel` is less verbose, providing the user with info that may help them self-diagnose setup problems.
6. Add a new `lldb-dap.verboseLogging` boolean settings, that will (1) change the `OutputChannel` log level from `info` to `debug`, and (2) make sure the `LLDBDAP_LOG` environment variable is set. If the `lldb-dap.log-path` setting is set by the user then will use this path, otherwise write the session log to `logUri/lldb-dap-session-YYYYMMDDHHMMSS.log`
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs