import logging import sys logger = logging.getLogger('YOUR LOGGER NAME') logger.setLevel(logging.DEBUG) handler = logging.StreamHandler(sys.stdout) formatter = logging.Formatter("%(asctime)s %(levelname)s %(name)s %(message)s") handler.setFormatter(formatter) logger.addHandler(handler)
This way you can see debug(), info(), warning(), error() and critical() messages printed in the console.
More information: Logging facility for Python and Logging on Plone.
No comments:
Post a Comment