Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

logging python

# simple logging example
import logging

level = logging.DEBUG
logging_format = "[%(levelname)s] %(asctime)s - %(message)s"
logging.basicConfig(level = level, format=logging_format)

def print_vs_logging():
    logging.debug("What is the value of this variable")
    logging.info("Just FYI")
    logging.error("We found the error")

print_vs_logging()
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #logging #python
ADD COMMENT
Topic
Name
6+4 =