-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featurelldb-dap
Description
While trying to diagnose debugging issues experienced by users of the 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:
- On activate the provided ExtensionContext has a
logUriproperty where VSCode wants the extension to write log files. There is a timestamped folder so you can find logs for older sessions. - Have an
LLDB-DAPLogOutputChannel where users can view some messaging provided by the extension to possibly diagnose their own problems, and vscode will write to a .log file underlogUri. winston is a popular MIT module for handling logging. The great thing about winston is you can add multiple transports. So you have one common logging interface but winston handles the writing to the multiple data sinks.Add a transport the writes to theOutputChannel. By default theOutputChanneltransport will have log levelinfoA log file transport will be added to write a log file under thelogUrifolder, and this log will be at thedebuglog level. So the log file captures everything to help with diagnosing issues, but theOutputChannelis less verbose, providing the user with info that may help them self-diagnose setup problems.- Add a new
lldb-dap.verboseLogginglldb-dap.captureSessionLogsboolean settings, that will(1) change themake sure theOutputChannellog level frominfotodebug, and (2)LLDBDAP_LOGenvironment variable is set. If thelldb-dap.log-pathsetting is set by the user then will use this path, otherwise write the session log tologUri/lldb-dap-session-YYYYMMDDHHMMSS.log
Metadata
Metadata
Assignees
Labels
enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featurelldb-dap