diff --git a/my/apple/privacy_export.py b/my/apple/privacy_export.py index 8e2b0b1b..dfbe1c2b 100644 --- a/my/apple/privacy_export.py +++ b/my/apple/privacy_export.py @@ -28,7 +28,7 @@ class config(user_config.privacy_export): from my.core.common import mcachew -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) class Game(NamedTuple): diff --git a/my/bash.py b/my/bash.py index fa59a72e..e3e672ca 100644 --- a/my/bash.py +++ b/my/bash.py @@ -45,7 +45,7 @@ class config(user_config): export_path: Paths -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: diff --git a/my/blizzard/gdpr.py b/my/blizzard/gdpr.py index 6ffb96c0..7ebe3526 100644 --- a/my/blizzard/gdpr.py +++ b/my/blizzard/gdpr.py @@ -26,7 +26,7 @@ class config(user_config.gdpr): from my.utils.input_source import InputSource -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: diff --git a/my/chess/export.py b/my/chess/export.py index 399d4a09..6dedba34 100644 --- a/my/chess/export.py +++ b/my/chess/export.py @@ -28,7 +28,7 @@ class config(user_config.export): export_path: Paths -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: diff --git a/my/discord/data_export.py b/my/discord/data_export.py index ce9a1cd0..5d30f40f 100644 --- a/my/discord/data_export.py +++ b/my/discord/data_export.py @@ -31,7 +31,7 @@ class config(user_config.data_export): from urlextract import URLExtract # type: ignore[import] -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def _remove_suppression(text: str, first_index: int, second_index: int) -> str: diff --git a/my/facebook/gdpr.py b/my/facebook/gdpr.py index 2e1160eb..fa339b0a 100644 --- a/my/facebook/gdpr.py +++ b/my/facebook/gdpr.py @@ -24,7 +24,7 @@ class config(user_config.gdpr): from my.utils.time import parse_datetime_sec -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) FacebookJson = Dict[Any, Any] diff --git a/my/listenbrainz/export.py b/my/listenbrainz/export.py index ee428080..d9a2fa42 100644 --- a/my/listenbrainz/export.py +++ b/my/listenbrainz/export.py @@ -26,7 +26,7 @@ class config(user_config.export): export_path: Paths -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: diff --git a/my/mal/export.py b/my/mal/export.py index 73d2064e..ccb6c706 100644 --- a/my/mal/export.py +++ b/my/mal/export.py @@ -37,7 +37,7 @@ class mal_config(user_config.export): config = make_config(mal_config) -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) # malexport supports multiple accounts diff --git a/my/mpv/history_daemon.py b/my/mpv/history_daemon.py index 45a8250b..c66160b9 100644 --- a/my/mpv/history_daemon.py +++ b/my/mpv/history_daemon.py @@ -38,18 +38,17 @@ class mpv_config(user_config.history_daemon): from my.core import get_files, Stats, LazyLogger from my.utils.input_source import InputSource -# monkey patch logs -if "HPI_LOGS" in os.environ: - from logzero import setup_logger # type: ignore[import] - from my.core.logging import mklevel - import mpv_history_daemon.events - mpv_history_daemon.events.logger = setup_logger( - name="mpv_history_events", level=mklevel(os.environ["HPI_LOGS"]) - ) +logger = LazyLogger(__name__) + +# monkey patch logs +from logzero import setup_logger # type: ignore[import] +import mpv_history_daemon.events -logger = LazyLogger(__name__, level="warning") +mpv_history_daemon.events.logger = setup_logger( + name="mpv_history_events", level=logger.level +) Results = Iterator[Media] diff --git a/my/skype/gdpr.py b/my/skype/gdpr.py index 1f418824..d0ad16e8 100644 --- a/my/skype/gdpr.py +++ b/my/skype/gdpr.py @@ -32,7 +32,7 @@ class config(user_config.gdpr): from my.core import get_files, LazyLogger from my.utils.input_source import InputSource -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) Results = Iterator[datetime] diff --git a/my/trakt/export.py b/my/trakt/export.py index 102ec397..8931544a 100644 --- a/my/trakt/export.py +++ b/my/trakt/export.py @@ -25,7 +25,7 @@ class config(user_config.export): export_path: Paths -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: @@ -59,7 +59,8 @@ def likes() -> Iterator[D.Like]: yield from _read_trakt_exports().likes -@mcachew(depends_on=_cachew_depends_on, logger=logger) +# TODO: hmm, cachew seems to fail with this one, not sure why +# @mcachew(depends_on=_cachew_depends_on, logger=logger) def watchlist() -> Iterator[D.WatchListEntry]: yield from _read_trakt_exports().watchlist diff --git a/my/twitch/gdpr.py b/my/twitch/gdpr.py index d8462fb3..df016bff 100644 --- a/my/twitch/gdpr.py +++ b/my/twitch/gdpr.py @@ -24,7 +24,7 @@ class config(user_config.gdpr): from my.core.common import get_files, LazyLogger, mcachew, Stats from my.utils.input_source import InputSource -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: diff --git a/my/twitch/overrustle_logs.py b/my/twitch/overrustle_logs.py index ab57a0ca..3296d58e 100644 --- a/my/twitch/overrustle_logs.py +++ b/my/twitch/overrustle_logs.py @@ -24,7 +24,7 @@ class config(user_config.overrustle): from .common import Event, Results -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def inputs() -> Sequence[Path]: diff --git a/my/zsh.py b/my/zsh.py index e1ce0c9c..8f379008 100644 --- a/my/zsh.py +++ b/my/zsh.py @@ -54,7 +54,7 @@ class config(user_config): live_file: Optional[PathIsh] -logger = LazyLogger(__name__, level="warning") +logger = LazyLogger(__name__) def backup_inputs() -> Sequence[Path]: