[Lldb-commits] [lldb] Logging setup for lldb-dap extension (PR #146884)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 29 09:48:26 PDT 2025
ashgti wrote:
If you create an output logger then you can use the output UI to set the log level and view / save logs.
For example, creating an output channel called 'lldb-dap'
```ts
const logger = vscode.window.createOutputChannel('lldb-dap', {log: true});
logger.info("Info...");
logger.onDidChangeLogLevel((level) => {
logger.debug('level changed to...', level);
});
```
This allows you to set the log level in the UI like so:
<img width="882" height="266" alt="Screenshot 2025-07-29 at 9 45 49 AM" src="https://github.com/user-attachments/assets/460750eb-6aca-4829-afa2-83d27a4c6abc" />
And includes options for users to save / export logs:
<img width="871" height="213" alt="Screenshot 2025-07-29 at 9 45 54 AM" src="https://github.com/user-attachments/assets/075ab1b8-b9b5-4d84-8658-4e0de4506f40" />
https://github.com/llvm/llvm-project/pull/146884
More information about the lldb-commits
mailing list