1
0
Fork 0

Rename xmpplogger into logging_sender

This commit is contained in:
Félix Piédallu 2024-02-08 22:18:59 +01:00
parent 74bab09292
commit 2f872cdb00
2 changed files with 6 additions and 5 deletions

View file

@ -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)

View file

@ -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()