HOME/Articles/

pil example debughelper (snippet)

Article Outline

Python pil example 'debughelper'

Modules used in program:

  • import logging

python debughelper

Python pil example: debughelper

import logging

ch = logging.StreamHandler()

logger=logging.getLogger()
# add ch to logger
if logger.hasHandlers()==False:
    ch = logging.StreamHandler()
    logger.addHandler(ch)
    formatter = logging.Formatter('%(asctime)s -%(name)s: %(message)s')
    ch.setFormatter(formatter)

logger.setLevel(10)