added logger

This commit is contained in:
Hellow 2023-07-18 21:10:32 +02:00
parent fa63eba982
commit d10b4fc1a1
3 changed files with 9 additions and 2 deletions

View File

@ -3,7 +3,7 @@ from urllib.parse import urlparse
import logging import logging
import json 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 from ..objects import Source, DatabaseObject
@ -62,7 +62,7 @@ class YoutubeMusicConnection(Connection):
class YoutubeMusic(Page): class YoutubeMusic(Page):
# CHANGE # CHANGE
SOURCE_TYPE = SourcePages.PRESET SOURCE_TYPE = SourcePages.PRESET
LOGGER = YOUTUBE_LOGGER LOGGER = YOUTUBE_MUSIC_LOGGER
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.connection: YoutubeMusicConnection = YoutubeMusicConnection(logger=self.LOGGER) self.connection: YoutubeMusicConnection = YoutubeMusicConnection(logger=self.LOGGER)

View File

@ -90,6 +90,11 @@ class LoggingSection(Section):
description="The logger for the youtube scraper.", description="The logger for the youtube scraper.",
value="youtube" 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( self.ENCYCLOPAEDIA_METALLUM_LOGGER = LoggerAttribute(
name="metal_archives_logger", name="metal_archives_logger",
description="The logger for the metal archives scraper.", description="The logger for the metal archives scraper.",
@ -114,6 +119,7 @@ class LoggingSection(Section):
self.DATABASE_LOGGER, self.DATABASE_LOGGER,
self.MUSIFY_LOGGER, self.MUSIFY_LOGGER,
self.YOUTUBE_LOGGER, self.YOUTUBE_LOGGER,
self.YOUTUBE_MUSIC_LOGGER,
self.ENCYCLOPAEDIA_METALLUM_LOGGER, self.ENCYCLOPAEDIA_METALLUM_LOGGER,
self.GENIUS_LOGGER self.GENIUS_LOGGER
] ]

View File

@ -53,6 +53,7 @@ OBJECT_LOGGER = LOGGING_SECTION.OBJECT_LOGGER.object_from_value
DATABASE_LOGGER = LOGGING_SECTION.DATABASE_LOGGER.object_from_value DATABASE_LOGGER = LOGGING_SECTION.DATABASE_LOGGER.object_from_value
YOUTUBE_LOGGER = LOGGING_SECTION.YOUTUBE_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 MUSIFY_LOGGER = LOGGING_SECTION.MUSIFY_LOGGER.object_from_value
GENIUS_LOGGER = LOGGING_SECTION.GENIUS_LOGGER GENIUS_LOGGER = LOGGING_SECTION.GENIUS_LOGGER
ENCYCLOPAEDIA_METALLUM_LOGGER = LOGGING_SECTION.ENCYCLOPAEDIA_METALLUM_LOGGER.object_from_value ENCYCLOPAEDIA_METALLUM_LOGGER = LOGGING_SECTION.ENCYCLOPAEDIA_METALLUM_LOGGER.object_from_value