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

feat(beta): force debug/verbose logging for Beta users #6033

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

justinmk3
Copy link
Contributor

@justinmk3 justinmk3 commented Nov 15, 2024

Problem

Beta and bug-bash users often need logs.

Solution

Log debug/verbose messages at "info" log-level. They will appear as "info" logs in the Output channel, even though they were logged at "debug" or "verbose" level.

Related

https://github.com/aws/aws-toolkit-vscode-staging/pull/1961 confirms CI behavior in a beta branch.


License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@justinmk3 justinmk3 requested a review from a team as a code owner November 15, 2024 18:27

This comment was marked as resolved.

@@ -120,6 +123,9 @@ export class ToolkitLogger extends BaseLogger implements vscode.Disposable {
}

override sendToLog(level: LogLevel, message: string | Error, ...meta: any[]): number {
// XXX: force debug/verbose logs for Beta users.
level = this.isBeta ? 'info' : level
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with this code so I can't tell if i'm missing something, but isn't this saying if its beta then use info? I thought we wanted verbose/debug if its beta users

Copy link
Contributor Author

@justinmk3 justinmk3 Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It forces the "sinks" (log providers such as Output channel, file, etc.) to log at "info" level. This forces the vscode Output channel to show logs that it would otherwise hide.

This is a hack because currently the vscode API doesn't give a way to programmatically set the Output channel log-level.

Pushed an improvement/fix: 87eebd4

Problem:
Beta and bug-bash users often need logs.

Solution:
Log debug/verbose messages at "info" log-level. They will appear as
"info" logs in the Output channel, even though they were logged at
"debug" or "verbose" level.
import { isReleaseVersion } from '../shared/vscode/env'
import { getRelativeDate } from '../shared/datetime'

const localize = nls.loadMessageBundle()
const logger = getLogger('dev/beta')

const downloadIntervalMs = 1000 * 60 * 60 * 24 // A day in milliseconds
const downloadIntervalMs = 1000 * 60 * 60 * 3 // 3 hours (8 times/day).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increase frequency

@justinmk3 justinmk3 merged commit e7c8784 into aws:master Nov 15, 2024
23 of 25 checks passed
@justinmk3 justinmk3 deleted the morebeta branch November 15, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants