Skip to content

Instantly share code, notes, and snippets.

@juan-ignacio-sanchez
Created September 2, 2021 18:45
Show Gist options
  • Select an option

  • Save juan-ignacio-sanchez/6bd02afc383c79fbe4e7aeb2397d3699 to your computer and use it in GitHub Desktop.

Select an option

Save juan-ignacio-sanchez/6bd02afc383c79fbe4e7aeb2397d3699 to your computer and use it in GitHub Desktop.
import queue
SLACK_QUEUE = queue.Queue()
LOGGING = {
...
'formatters': {...},
'handlers': {
...
'slack': {
'class': 'logging.handlers.QueueHandler', # Set QueueHandler as the new handler.
'level': 'DEBUG',
'queue': SLACK_QUEUE, # Set the queue used to inter-thread communication.
}
},
'loggers': {...},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment