may be this you will find usefull: def getLog(logName, fileName = None):
if fileName: hdl = logging.FileHandler(fileName) else: hdl = logging.StreamHandler() fmt = logging.Formatter("%(name)s:\t%(levelname)s:\t%(asctime)s:\t%(message)s") hdl.setFormatter(fmt) log = logging.getLogger(logName) log.addHandler(hdl) return log 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. > > Thomas -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list