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 PlaygroundTags
stdlibloggingdebuggingmonitoring
Related Items
print()
Built-in Function
Outputs text or values to the console
warnings
Stdlib — Testing
Issue and control warning messages
loguru
Package — Utility
Simplified logging with structured output
structlog
Package — Utility
Structured logging for easy parsing and analysis
sentry-sdk
Package — Logging
Error tracking and performance monitoring