Skip to content

Python Logging_114787676

nxi edited this page Apr 9, 2015 · 1 revision
Created by Tony Lam, last modified on Jan 18, 2009

Links

Logging facility for Python - official documentation
Python Standard Logging - O'Reilly's article
A Logging System for Python - logging configuration
Python Loggin Documentation - logging package documentation

Examples

logger = logging.getLogger("simple_example")

logger.setLevel(logging.DEBUG)

ch = logging.StreamHandler()

formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")

ch.setFormatter(formatter)

logger.addHandler(ch)


logger.debug("debug message")

logger.info("info message")
Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally