Skip to content

Instantly share code, notes, and snippets.

@mpslanker
Created June 12, 2025 17:12
Show Gist options
  • Save mpslanker/2be63853aa3b0c218628ce861e49c888 to your computer and use it in GitHub Desktop.
Save mpslanker/2be63853aa3b0c218628ce861e49c888 to your computer and use it in GitHub Desktop.
Python3 Logging Module BasicConfig Example
import logging
# Configure logging to print to the console
logging.basicConfig(level=logging.DEBUG)
# Create a logger
logger = logging.getLogger(__name__)
# Log messages at different levels
logger.debug("This is a debug message")
logger.info("This is an info message")
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment