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

fix: add sf log level to current runtime #5444

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

peternhale
Copy link
Contributor

Enables debug logging for libraries that consume the env var SF_LOG_LEVEL by pushing the extension setting into the current process.env.

One should expect commands such as deploy to org or retrieve from org show show debug log entries to the sf log files, when the log level is set to the correct level used by the libraries.

Added validation of ext setting to ensure the setting values match those provided by core logging config.

@W-15062541@

Copy link
Member

@mingxuanzhangsfdx mingxuanzhangsfdx left a comment

Choose a reason for hiding this comment

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

With the change, I could see the vscode setting SF_LOG_LEVEL has the 6 options that match sf cli log level. With the debug level, I was able to see the log records in $HOME/.sf/sf-.log whereas it is empty when it is fatal.

@@ -109,7 +109,7 @@ export class SfdxCoreSettings {
public getSfLogLevel(): string {
return this.getConfigValue(
ENV_SF_LOG_LEVEL,
process.env.SF_LOG_LEVEL ?? ''
process.env.SF_LOG_LEVEL ?? 'debug'
Copy link
Member

Choose a reason for hiding this comment

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

Given that the above default is fatal, why don't you keep it here same?

@peternhale peternhale merged commit bc7847b into develop Feb 22, 2024
12 checks passed
@peternhale peternhale deleted the phale/W-15062541-log-level branch February 22, 2024 20:06
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.

None yet

2 participants