Skip to content

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

@jiasli

Description

@jiasli

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions