From d10b4fc1a12ab96f6cbb6ce2def57cfefc4ba7d9 Mon Sep 17 00:00:00 2001 From: Hellow <74311245+HeIIow2@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:10:32 +0200 Subject: [PATCH] added logger --- src/music_kraken/pages/youtube_music.py | 4 ++-- src/music_kraken/utils/config/logging.py | 6 ++++++ src/music_kraken/utils/shared.py | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/music_kraken/pages/youtube_music.py b/src/music_kraken/pages/youtube_music.py index dcbe994..b344577 100644 --- a/src/music_kraken/pages/youtube_music.py +++ b/src/music_kraken/pages/youtube_music.py @@ -3,7 +3,7 @@ from urllib.parse import urlparse import logging import json -from music_kraken.utils.shared import PROXIES_LIST, YOUTUBE_LOGGER +from music_kraken.utils.shared import PROXIES_LIST, YOUTUBE_MUSIC_LOGGER from ..objects import Source, DatabaseObject @@ -62,7 +62,7 @@ class YoutubeMusicConnection(Connection): class YoutubeMusic(Page): # CHANGE SOURCE_TYPE = SourcePages.PRESET - LOGGER = YOUTUBE_LOGGER + LOGGER = YOUTUBE_MUSIC_LOGGER def __init__(self, *args, **kwargs): self.connection: YoutubeMusicConnection = YoutubeMusicConnection(logger=self.LOGGER) diff --git a/src/music_kraken/utils/config/logging.py b/src/music_kraken/utils/config/logging.py index fe9c8c2..c972934 100644 --- a/src/music_kraken/utils/config/logging.py +++ b/src/music_kraken/utils/config/logging.py @@ -90,6 +90,11 @@ class LoggingSection(Section): description="The logger for the youtube scraper.", value="youtube" ) + self.YOUTUBE_MUSIC_LOGGER = LoggerAttribute( + name="youtube_music_logger", + description="The logger for the youtube music scraper.\n(The scraper is seperate to the youtube scraper)", + value="youtube_music" + ) self.ENCYCLOPAEDIA_METALLUM_LOGGER = LoggerAttribute( name="metal_archives_logger", description="The logger for the metal archives scraper.", @@ -114,6 +119,7 @@ class LoggingSection(Section): self.DATABASE_LOGGER, self.MUSIFY_LOGGER, self.YOUTUBE_LOGGER, + self.YOUTUBE_MUSIC_LOGGER, self.ENCYCLOPAEDIA_METALLUM_LOGGER, self.GENIUS_LOGGER ] diff --git a/src/music_kraken/utils/shared.py b/src/music_kraken/utils/shared.py index b8dbe55..97d594f 100644 --- a/src/music_kraken/utils/shared.py +++ b/src/music_kraken/utils/shared.py @@ -53,6 +53,7 @@ OBJECT_LOGGER = LOGGING_SECTION.OBJECT_LOGGER.object_from_value DATABASE_LOGGER = LOGGING_SECTION.DATABASE_LOGGER.object_from_value YOUTUBE_LOGGER = LOGGING_SECTION.YOUTUBE_LOGGER.object_from_value +YOUTUBE_MUSIC_LOGGER = LOGGING_SECTION.YOUTUBE_MUSIC_LOGGER.object_from_value MUSIFY_LOGGER = LOGGING_SECTION.MUSIFY_LOGGER.object_from_value GENIUS_LOGGER = LOGGING_SECTION.GENIUS_LOGGER ENCYCLOPAEDIA_METALLUM_LOGGER = LOGGING_SECTION.ENCYCLOPAEDIA_METALLUM_LOGGER.object_from_value