Open ludgerh opened 1 year ago
"Better Late than Never".
I fixed a similar issue today. In my case, onvif was overriding my own logging.basicConfig()
, so I moved logging.basicConfig()
into a separate config.py
file and imported into a file that interacts with onvif, like
from config import logging
instead of
import logging
Hope this helps you.
...thank you, Waramoto, for your hint. As you might have guessed, I had to find a solution in the meantime. I modified client.py according to my standard way of doing the logging. I added
def init_log(mylogger):
global logger
if mylogger:
logger = mylogger
else:
import logging
logger = logging.getLogger('onvif')
logging.basicConfig(level=logging.INFO)
logging.getLogger('zeep.client').setLevel(logging.CRITICAL)
and call init_log before using ONVIF. Best regards from Aachen, Germany Ludger
"Better Late than Never".
I fixed a similar issue today. In my case, onvif was overriding my own
logging.basicConfig()
, so I movedlogging.basicConfig()
into a separateconfig.py
file and imported into a file that interacts with onvif, like
from config import logging
instead of
import logging
Hope this helps you.
Thank you very much =) you gave me the idea to simply move the module import into the initialization of the fastapi application. This way, my logger was imported before the module that pulls in onvif.
I have an application with extensive logging. When I import onvif
from onvif import ONVIFCamera, exceptions
all logging lines from the rest of the application are doubbled:Is there a way of disabling the logging completely and leave it to calling application?
This is my logging call, being used by several processes, each seperately: