Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create a logger object.
- import logging
- logger = logging.getLogger('your-module')
- # Initialize coloredlogs.
- import coloredlogs
- coloredlogs.install(
- datefmt='%d/%m %H:%M',
- fmt='%(asctime)s %(levelname)s %(message)s',
- level='DEBUG',
- )
- # Some examples.
- logger.debug("this is a debugging message")
- logger.info("this is an informational message")
- logger.warn("this is a warning message")
- logger.error("this is an error message")
- logger.critical("this is a critical message")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement