-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Logger util #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor cleanup
info: (label, ...args) => console.info(`[${label}] INFO:`, ...args), | ||
debug: (label, ...args) => console.debug(`[${label}] DEBUG:`, ...args), | ||
debug2: (label, ...args) => console.debug(`[${label}] DEBUG2:`, ...args), | ||
error: console.error.bind(console), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the label's not being printed with the square brackets. In the private handle
method below, wrap the this.label
in square brackets so it's printed correctly.
src/util/Toaster.ts
Outdated
showErrorMessage = async (message: string) => { | ||
const response = await vscode.window.showErrorMessage( | ||
message, | ||
DOWNLOAD_LOGS_TEXT | ||
); | ||
|
||
// If user clicks "Download Logs" button | ||
if (response === DOWNLOAD_LOGS_TEXT) { | ||
await vscode.commands.executeCommand(DOWNLOAD_LOGS_CMD); | ||
} | ||
}; | ||
|
||
showInfoMessage = async (message: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably just name these messages error
and info
respectively, similar to our Logger
class. Up to you though.
src/util/OutputChannelWithHistory.ts
Outdated
) { | ||
this.name = outputChannel.name; | ||
|
||
// Have to bind this explicilty since function overloads prevent using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Have to bind this explicilty since function overloads prevent using | |
// Have to bind this explicitly since function overloads prevent using |
Testing
resolves #33