Disable logging from imported modules

The logging from imported modules (stem, in particular) has caused quite
a few users to assume there are errors where there aren't any. The logs
from stem also aren't helpful, as everything in the library works as
expected despite the implication from the logs that it is not working.
main
Ben Busby 2021-04-09 09:26:16 -04:00
parent a321d55f13
commit ed32fb927c
No known key found for this signature in database
GPG Key ID: 3B08611DF6E62ED2
1 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,7 @@ from app.utils.bangs import gen_bangs_json
from flask import Flask from flask import Flask
from flask_session import Session from flask_session import Session
import json import json
import logging.config
import os import os
from stem import Signal from stem import Signal
from dotenv import load_dotenv from dotenv import load_dotenv
@ -74,3 +75,9 @@ Session(app)
send_tor_signal(Signal.HEARTBEAT) send_tor_signal(Signal.HEARTBEAT)
from app import routes # noqa from app import routes # noqa
# Disable logging from imported modules
logging.config.dictConfig({
'version': 1,
'disable_existing_loggers': True,
})