diff --git a/appslib/xmpplogger.py b/appslib/logging_sender.py similarity index 80% rename from appslib/xmpplogger.py rename to appslib/logging_sender.py index c13faef..9cd9c80 100644 --- a/appslib/xmpplogger.py +++ b/appslib/logging_sender.py @@ -6,13 +6,14 @@ import logging import logging.handlers -class XmppLogHandler(logging.Handler): +class LogSenderHandler(logging.Handler): def __init__(self): logging.Handler.__init__(self) self.is_logging = False def emit(self, record): if which("sendxmpppy") is None: + logging.warning("Could not send error via xmpp.") return msg = f"[Applist builder error] {record.msg}" @@ -31,5 +32,5 @@ class XmppLogHandler(logging.Handler): def enable(): - """Enables the XmppLogHandler""" - XmppLogHandler.add(logging.ERROR) + """Enables the LogSenderHandler""" + LogSenderHandler.add(logging.ERROR) diff --git a/list_builder.py b/list_builder.py index 586d49b..cf746d9 100755 --- a/list_builder.py +++ b/list_builder.py @@ -17,7 +17,7 @@ import tqdm from tqdm.contrib.logging import logging_redirect_tqdm from git import Repo -import appslib.xmpplogger # pylint: disable=import-error +import appslib.logging_sender # pylint: disable=import-error from app_caches import app_cache_folder # pylint: disable=import-error from app_caches import apps_cache_update_all # pylint: disable=import-error from appslib.utils import (REPO_APPS_ROOT, # pylint: disable=import-error @@ -249,7 +249,7 @@ def build_app_dict(app, infos): def main() -> None: - appslib.xmpplogger.enable() + appslib.logging_sender.enable() apps_cache_update_all(get_catalog(), parallel=50) catalog = build_base_catalog()