mirror of
https://github.com/craigerl/aprsd.git
synced 2025-03-08 04:18:59 -05:00
Disable debug logs for aprslib
This patch adds a disable of propogating the debug logs from the aprslib parsing. We don't really need to see this in our aprsd services.
This commit is contained in:
parent
5d3f42f411
commit
24bbea1d49
@ -45,11 +45,24 @@ def setup_logging(loglevel=None, quiet=False):
|
||||
logging.root.handlers = [InterceptHandler()]
|
||||
logging.root.setLevel(log_level)
|
||||
|
||||
imap_list = [
|
||||
"imapclient.imaplib", "imaplib", "imapclient",
|
||||
"imapclient.util",
|
||||
]
|
||||
aprslib_list = [
|
||||
"aprslib",
|
||||
"aprslib.parsing",
|
||||
"aprslib.exceptions",
|
||||
]
|
||||
|
||||
# We don't really want to see the aprslib parsing debug output.
|
||||
disable_list = imap_list + aprslib_list
|
||||
|
||||
# remove every other logger's handlers
|
||||
# and propagate to root logger
|
||||
for name in logging.root.manager.loggerDict.keys():
|
||||
logging.getLogger(name).handlers = []
|
||||
if name in ["imapclient.imaplib", "imaplib", "imapclient", "imapclient.util"]:
|
||||
if name in disable_list:
|
||||
logging.getLogger(name).propagate = False
|
||||
else:
|
||||
logging.getLogger(name).propagate = True
|
||||
@ -69,11 +82,7 @@ def setup_logging(loglevel=None, quiet=False):
|
||||
)
|
||||
|
||||
if CONF.email_plugin.enabled and CONF.email_plugin.debug:
|
||||
imaps = [
|
||||
"imapclient.imaplib", "imaplib", "imapclient",
|
||||
"imapclient.util",
|
||||
]
|
||||
for name in imaps:
|
||||
for name in imap_list:
|
||||
logging.getLogger(name).propagate = True
|
||||
|
||||
if CONF.admin.web_enabled:
|
||||
|
Loading…
Reference in New Issue
Block a user