Az.Cli
Az.Cli copied to clipboard
Disable logging of library
Is your feature request related to a problem? Please describe.
When I import az.cli
and logging
, logging
show the log of az.cli
as well.
Describe the solution you'd like
An option or property to disable logs of az.cli
. I think there should be an if
command at these lines
https://github.com/MarkWarneke/Az.Cli/blob/c69eed85afb81bcb34e49b87ef81608f18fc137c/src/az/cli.py#L67-L75
Additional context
I am with same issue! Someone knows how to solve?
I was wrangling with the logging part a bit.
I did not yet find the time yet to investigate this further.
If someone has a better way to disable the internal CLI log outputs I would very much appreciate some help.
I've tried some methods, but unfortunatelly unsucessfully!
import logging
from az.cli import az
logging.getLogger('az').setLevel(logging.ERROR)
...
...
az("ad group show --group GROUP_NAME -o none")
...
...
az("ad group show --group GROUP_NAME --only-show-errors")
...
Regards.
It took me several days to find out how to disable the log of CLI. Fortunately, I found another cool library for logging: https://github.com/Delgan/loguru. Using this library won't show any log of AZ CLI.
Hope that it can help you