Logging Events¶
Logging Levels¶
When needed, always log through the in-built python logging module. Refrain
from using print()
statements in a production environment. Default logging
levels for each mode are:
Operation Mode | Logging Level |
---|---|
development | debug |
testing | info |
staging | warning |
production | error |
Logging Example¶
Python
import logging
# Logging Config
LOGGING_CONFIG = {}
logging_format = "[%(asctime)s] %(levelname)s::%(module)s: %(message)s"
logging.basicConfig(format=logging_format, level=logging.INFO)
log = logging.getLogger()
log.debug("debug message")
log.info("info message")
log.warning("warn message")
log.error("error message")
log.critical("critical message")