在日志文件中禁用异常

时间:2019-07-15 14:23:56

标签: python logging zeep

我想禁用或过滤以下警告。

稍后,似乎来自zeep记录器,因此我尝试使用以下命令将此记录器级别设置为CRITICAL以避免警告消息,但此方法不起作用。

logging.getLogger("zeep").setLevel(logging.CRITICAL)

为重新说明我的问题,我希望控制台或日志文件上都不会出现以下消息。

Traceback (most recent call last):
  File "C:/Users/aelbouha/Desktop/Bnetza DataSet/mastr_temp.py", line 458, in download_unit_wind_permit
    unit_wind_permit = get_unit_wind_permit(unit_wind_list[i])
  File "C:/Users/aelbouha/Desktop/Bnetza DataSet/mastr_temp.py", line 245, in get_unit_wind_permit
    genMastrNummer=mastr_wind_permit)
  File "C:\Users\aelbouha\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\proxy.py", line 45, in __call__
    kwargs,
  File "C:\Users\aelbouha\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py", line 130, in send
    return self.process_reply(client, operation_obj, response)
  File "C:\Users\aelbouha\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py", line 195, in process_reply
    return self.process_error(doc, operation)
  File "C:\Users\aelbouha\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py", line 299, in process_error
    detail=fault_node.find("detail"),
zeep.exceptions.Fault: Objekt nicht gefunden

0 个答案:

没有答案