Repository navigation
Logging in Extension #2156
Copy link
Copy link
Closed
Labels
area-diagnosticsLogging/Features to facilitate diagnosing user problemsLogging/Features to facilitate diagnosing user problemsdebtCode quality issuesCode quality issues
Description
Goal: Improved logging within the extension for diagnostics
Resources:
- VSC provides logging API (currently in preview)
- Different log levels provided by VSC include:
Trace = 1,
Debug = 2,
Info = 3,
Warning = 4,
Error = 5,
Critical = 6,
Off = 7
Definitions:
- Critical = Contribute to extension not functioning at all, or something that must be fixed.
- Error = Contribute to features that may/may not function
- Warning = Indication of a feature that may not function correctly
- Info = Messages that will be generally useful for users
- Debug = Debug messages (for diagnostics)
- Trace = Everything (for diagnostics)
Requirements:
- Use VSC api as the backing store for logs (today we log into console window and output panel)
- Decide what must be logged and what categories each log message fall under
- Document how users can change log level
- Document how users can capture log output (for issues)
- Determine default log levels of VS Code (ideally i'd like to see
infoand above)
Generic logs and log levels:
- All external (process) commands executed must be logged with status of
Info - All errors encountered must be logged with status of
Error(even if error is displayed to the user) - Output of commands should be logged at a level of
Debug(e.g. Linting, Testing, formatting, etc)
Formatting
- Logging formatting output would be an exception. The output is generally a diff of the entire file. So, the output could be as large/larger than size of file.
- Discuss:
- Log level to view this output
- Or should we have a special switch for this, i.e. output this?
Linting
Environments
- Exception when conda cannot be found (we know whether conda exists by trying to run
condacommand)- Log level for these errors = Debug
Environments
- Errors in detecting pipenv, conda, etc =
Trace
@Microsoft/pvsc-team
- Please feel free to add a list of items that need to be logged along with the log level
Process Output
- Log all process output that will be subsequently parsed/processed.
E.g. when getting linting output from pylint, log that output to the console window. Log all output.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-diagnosticsLogging/Features to facilitate diagnosing user problemsLogging/Features to facilitate diagnosing user problemsdebtCode quality issuesCode quality issues
Activity
DonJayamanne commentedon Jun 18, 2019
Got those subscribed to this issue, VSC have removed the logging API in their insiders build. They have only exposed log levels.
My suggestion, let's not wait for their API, just keep using what we have (Winston logging package) but we could perhaps implement the log levels, categories and the like...
luabud commentedon Apr 8, 2020
Related to #8527.
kimadeline commentedon Oct 21, 2021
Partially addressed by #9837 #11699, closing in favor of #13076.