gijzelaerr / python-snap7

A Python wrapper for the snap7 PLC communication library
http://python-snap7.readthedocs.org/
MIT License
663 stars 246 forks source link

tomany logging messages #238

Closed amarco closed 3 years ago

amarco commented 3 years ago

I have tried a few different things and am unable to reduce the number of log messages in the python console window from the snap7 wrapper. What is the suggested way to disable or reduce the level of meesages. I tried logging.basicconfig(level...) to no avail. Clearly I dont understand logging implementation :(

gijzelaerr commented 3 years ago

basicconfig should work, you need to specify the minimum loglevel you want to see. So if you only want to see warnings and errors, use:

import logging
logging.basicconfig(level=logging.WARNING)