logging

Stdlib — MiscPython 2.3+Intermediate

Flexible logging: loggers, handlers, formatters, levels

Quick Info

Documentation
Official Docs
Python Version
2.3+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("myapp")

logger.debug("Debug message")
logger.info("Info message")
logger.warning("Warning message")
logger.error("Error message")

The logging module is part of Python's standard library. Flexible logging: loggers, handlers, formatters, levels.

Try in Playground

Tags

stdlibloggingdebuggingmonitoring

Related Items