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
parent
a321d55f13
commit
ed32fb927c
|
@ -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,
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue