-
Notifications
You must be signed in to change notification settings - Fork 195
Enable debugger logs
Karthik Nadig edited this page Mar 26, 2020
·
5 revisions
You can enable debugger logs by setting "logToFile": true in the debug configuration in the launch.json for your work space. When using with ms-python.python extension the logs files will be stored in the extension root (unix/mac: ~/.vscode/extensions/ms-python.python-*, windows %USERPROFILE%\.vscode\extensions\ms-python.python-*)
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"logToFile": true
}Set DEBUGPY_LOG_DIR environment variable to enable debugger logs. Ensure that the path provided to DEBUGPY_LOG_DIR is a valid directory.
DEBUGPY_LOG_DIR=<path to log directory>
Another way to log is using CLI, see here. You can use --log-to to enable logging and provide a directory where logs should be stored.
> python3 -m debugpy --listen 5678 --wait-for-client --log-to ~/logs myscript.py