Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created April 20, 2023 06:25
Show Gist options
  • Save goddoe/0bb2753398928e9ef6e6f66eb17bbd8e to your computer and use it in GitHub Desktop.
Save goddoe/0bb2753398928e9ef6e6f66eb17bbd8e to your computer and use it in GitHub Desktop.
logging
import logging
import sys
# Setup logging
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
datefmt="%m/%d/%Y %H:%M:%S",
handlers=[logging.StreamHandler(sys.stdout)],
)
logger = logging.getLogger(__name__)
# logger.setLevel(log_level)
logger.warning("warning")
logger.info("info")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment