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

[Feature Request] Turn on DEBUG log for all commands #19909

Open
jiasli opened this issue Oct 16, 2021 · 1 comment
Open

[Feature Request] Turn on DEBUG log for all commands #19909

jiasli opened this issue Oct 16, 2021 · 1 comment

Comments

@jiasli
Copy link
Member

jiasli commented Oct 16, 2021

Context

There could be a method to turn on DEBUG log for all commands, like turning on DEBUG log for all PowerShell cmdlets through

$DebugPreference = "Continue"

Currently, CLI can enable log file with logging.enable_log_file (https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration) which prints all levels of logs.

Proposals

Add core.debug config option

A config option core.debug can be added, like core.only_show_error. However, there will still be no option to always show INFO logs.

Add core.log_level config option and --log-level argument

Like log_cli_level from pytest (https://docs.pytest.org/en/6.2.x/logging.html#live-logs), a more general solution is to add core.log_level config option and --log-level argument which can be set to

  • debug
  • info
  • warning
  • error

This is a superset of

  • core.only_show_errors/--only-show-errors (Support --only-show-errors microsoft/knack#179), which is equivalent to core.log_level=error/--log-level error
  • --debug, which is equivalent to core.log_level=debug/--log-level debug
  • --verbose, which is equivalent to core.log_level=info/--log-level info

References

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 16, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 16, 2021

Feature Request

@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 16, 2021
@yonzhan yonzhan added this to the Backlog milestone Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants