Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Standardize Logging Levels and Meanings #5101

Open
2 tasks done
JustinGrote opened this issue Nov 25, 2024 · 1 comment
Open
2 tasks done

RFC: Standardize Logging Levels and Meanings #5101

JustinGrote opened this issue Nov 25, 2024 · 1 comment
Labels
Area-Logging Issue-Enhancement A feature request (enhancement).

Comments

@JustinGrote
Copy link
Collaborator

JustinGrote commented Nov 25, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

Now that the logging infrastructure has been relatively standardized between vscode-powershell and PSES, I feel like we need to add some logging guidelines to the developer guide, and update severities for existing messages.

Proposed Design

I want there to be specific "layers" that you peel back as you need to investigate an issue, here's my thoughts in order of least verbose to most verbose:

  • Critical: Fully unhandled exceptions or anything causing a hard stop/panic of PSES or the editor. These would almost always be surfaced as warning dialogs if at all possible.
  • Error: Some functionality of the extension/LSP did not complete, but was handled and does not require a critical restart of the environment. Not necessarily surfaced to user outside of logs unless action required. No values shown unless it's explicitly relevant to the error (e.g. expected x but received y)
  • Warning: Degraded but successfully completed behavior, Notify of deprecated functionality. Same rules as error (action required). Warning would be the default level, basically not logging anything and keeping performance up with logging noops unless something goes wrong (Maybe Info is better for newbies)
  • Info/Verbose: Logs the high level steps of the initialization of PSES, and any configuration or operational changes.
  • Debug: Logs the invocation of handlers, summary of request/response (without values), detail about steps such as launch process, etc.
  • Trace: Full protocol logging including values

The overarching idea is that anything Debug or above would only contain values/potential PII about the environment itself, whereas trace may include everything the user did or requested including script contents, so users can feel fairly safe about analyzing and submitting debug level reports, whereas trace reports may require some sanitization.

@JustinGrote JustinGrote added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! Area-Logging and removed Needs: Triage Maintainer attention needed! labels Nov 25, 2024
@andyleejordan
Copy link
Member

I approve 👍 (I've wanted to clean up and standardize our logging since forever, I did an ok pass on the client a little while ago but the server was still a mess.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Logging Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

2 participants