-
Notifications
You must be signed in to change notification settings - Fork 4
Django Logger
Andreï Basdereff edited this page Sep 27, 2024
·
3 revisions
import logging
logger = logging.getLogger(__name__)
Logging provides several levels of severity for log messages:
- DEBUG: Detailed information, typically of interest only when diagnosing problems.
- INFO: Confirmation that things are working as expected.
- WARNING: An indication that something unexpected happened, or indicative of some problem in the near future.
- ERROR: Due to a more serious problem, the software has not been able to perform some function.
- CRITICAL: A serious error, indicating that the program itself may be unable to continue running.
logging.debug('This is a debug message')
logging.info('This is an info message')
logging.warning('This is a warning message')
logging.error('This is an error message')
logging.critical('This is a critical message')