Make the showAndLog family of functions usable without the vscode module#2511
Merged
Make the showAndLog family of functions usable without the vscode module#2511
vscode module#2511Conversation
91f1109 to
7f73966
Compare
This moves the `showAndLog` family of functions to the `common/logging` directory. It explicitly moves the `showAndLogExceptionWithTelemetry` function to the `common/vscode/logging.ts` file because it still has a dependency on the `telemetryListener`, which depends on the `vscode` module.
To increase the use of the `app` logger, this replaces the direct use of `extLogger` by the `app.logger` where possible. This should not change the behavior since the `extLogger` is the logger used by the `app`.
7f73966 to
108d526
Compare
robertbrignull
approved these changes
Jun 14, 2023
Contributor
robertbrignull
left a comment
There was a problem hiding this comment.
LGTM
This is a good step towards untangling VS Code dependencies. Sadly results in some more logger arguments passed to methods, but I think that's largely unavoidable.
I understand there's another PR to come that'll deal with the telemetry, so I've not looked too hard at that area.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the following functions callable without a dependency on the
vscodemodule:showAndLogErrorMessageshowAndLogWarningMessageshowAndLogInformationMessageThis PR does not yet fix the
showAndLogExceptionWithTelemetryfunction since it has a dependency on thetelemetryListener, which imports thevscodemodule. This will be fixed in a follow-up PR.Unfortunately, most of the call sites are still using
extLoggeras argument rather thanapp.logger. I'm hoping that this will be fixed in the future as we move more to using theApp.Please review this PR commit-by-commit. Each commit is relatively self-contained and most changes in each commit are changing 1 file path or call signature.
Checklist
ready-for-doc-reviewlabel there.