Rename xmpplogger into logging_sender
This commit is contained in:
parent
74bab09292
commit
2f872cdb00
2 changed files with 6 additions and 5 deletions
|
@ -6,13 +6,14 @@ import logging
|
||||||
import logging.handlers
|
import logging.handlers
|
||||||
|
|
||||||
|
|
||||||
class XmppLogHandler(logging.Handler):
|
class LogSenderHandler(logging.Handler):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
logging.Handler.__init__(self)
|
logging.Handler.__init__(self)
|
||||||
self.is_logging = False
|
self.is_logging = False
|
||||||
|
|
||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
if which("sendxmpppy") is None:
|
if which("sendxmpppy") is None:
|
||||||
|
logging.warning("Could not send error via xmpp.")
|
||||||
return
|
return
|
||||||
|
|
||||||
msg = f"[Applist builder error] {record.msg}"
|
msg = f"[Applist builder error] {record.msg}"
|
||||||
|
@ -31,5 +32,5 @@ class XmppLogHandler(logging.Handler):
|
||||||
|
|
||||||
|
|
||||||
def enable():
|
def enable():
|
||||||
"""Enables the XmppLogHandler"""
|
"""Enables the LogSenderHandler"""
|
||||||
XmppLogHandler.add(logging.ERROR)
|
LogSenderHandler.add(logging.ERROR)
|
|
@ -17,7 +17,7 @@ import tqdm
|
||||||
from tqdm.contrib.logging import logging_redirect_tqdm
|
from tqdm.contrib.logging import logging_redirect_tqdm
|
||||||
from git import Repo
|
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 app_cache_folder # pylint: disable=import-error
|
||||||
from app_caches import apps_cache_update_all # 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
|
from appslib.utils import (REPO_APPS_ROOT, # pylint: disable=import-error
|
||||||
|
@ -249,7 +249,7 @@ def build_app_dict(app, infos):
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
appslib.xmpplogger.enable()
|
appslib.logging_sender.enable()
|
||||||
apps_cache_update_all(get_catalog(), parallel=50)
|
apps_cache_update_all(get_catalog(), parallel=50)
|
||||||
|
|
||||||
catalog = build_base_catalog()
|
catalog = build_base_catalog()
|
||||||
|
|
Loading…
Reference in a new issue