How to prevent logging warning?
maksim.kasimov at gmail.com
Wed Oct 5 15:09:05 CEST 2005
may be this you will find usefull:
def getLog(logName, fileName = None):
hdl = logging.FileHandler(fileName)
hdl = logging.StreamHandler()
fmt = logging.Formatter("%(name)s:\t%(levelname)s:\t%(asctime)s:\t%(message)s")
log = logging.getLogger(logName)
Thomas Heller wrote:
> I'm about to add some logging calls to a library I have. How can I
> prevent that the script that uses the library prints
> 'No handlers could be found for logger "comtypes.client"' when the
> script runs?
> I would like to setup the logging so that there is no logging when
> nothing is configured, and no warning messages are printed.
mailto: maksim.kasimov at gmail.com
More information about the Python-list