Skip to content

Commit

Permalink
add(log): on notify
Browse files Browse the repository at this point in the history
  • Loading branch information
gjeusel committed Jun 17, 2023
1 parent 9107c5d commit 243ff28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions neatpush/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def check_new_chapters() -> dict[str, list[MangaChapter]]:
map_new_chapters = manga.get_new_chapters()

if map_new_chapters:
logger.info("notifying", **map_new_chapters)
title, body = _format_notif_infos(map_new_chapters)

CFG.notif_manager.notify(
Expand Down
4 changes: 4 additions & 0 deletions neatpush/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

PKG_DIR = Path(__file__).parents[1]

logger = structlog.getLogger()


class Config(pydantic.BaseSettings):
# Scaleway limitation: env variable can't start with "SCW" (reserved)
Expand Down Expand Up @@ -40,9 +42,11 @@ def notif_manager(self) -> apprise.Apprise:

if secret := self.SIMPLE_PUSH_KEY.get_secret_value():
manager.add(f"spush://{secret}", tag="always")
logger.info("Simple Push has been set.")

if secret := self.TECHULUS_PUSH_KEY.get_secret_value():
manager.add(f"push://{secret}/", tag="always")
logger.info("Technulus has been set.")

self._notif_manager = manager

Expand Down

0 comments on commit 243ff28

Please sign in to comment.