Skip to content

Instantly share code, notes, and snippets.

@kumar-de
Last active April 16, 2020 22:42
Show Gist options
  • Save kumar-de/fe932a0c35796b371d0091ab85c9ce65 to your computer and use it in GitHub Desktop.
Save kumar-de/fe932a0c35796b371d0091ab85c9ce65 to your computer and use it in GitHub Desktop.
Logging control in Python #logging #python #log #level
import logging

logging.basicConfig(format='%(asctime)s - %(process)d - %(levelname)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO)

Reduce log level

logging.getLogger("pika").setLevel(logging.WARNING)

Or, disable propagation

logging.getLogger("pika").propagate = False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment