Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

Provide a solution to turn off error logging #687

Open northtyphoon opened 3 years ago

northtyphoon commented 3 years ago

Which service(blob, file, queue) does this issue concern?

blob

Which version of the SDK was used? Please provide the output of pip freeze.

the sdk integrated in latest azure cli

What problem was encountered?

the following code always writes a message to stderr in azure cli. need a way to disable it as it pollutes the cli output for legitimate cases.

https://github.com/Azure/azure-storage-python/blob/master/azure-storage-common/azure/storage/common/storageclient.py#L440

Have you found a mitigation/solution?

no

https://github.com/Azure/azure-cli/issues/16700

frankShih commented 3 years ago

really need this !!!

xiafu-msft commented 3 years ago

You can take this as reference to disable logger named azure.storage https://github.com/Azure/azure-storage-python/blob/master/tests/testcase.py#L99 remember to get a logger instance like this before disable it https://github.com/Azure/azure-storage-python/blob/master/tests/testcase.py#L84

Let me know if it doesn’t work.