Move logging messages to WalkConfig
MODIFY
plextraktsync/commands/sync.py
plextraktsync/commands/sync.py
@@ -96,17 +96,13 @@ def sync(
w = Walker(plex=plex, trakt=trakt, mf=mf, config=wc, progressbar=pb)
if id:
- logger.info(f"Syncing item: {id}")
wc.add_id(id)
if library:
- logger.info(f"Filtering Library: {library}")
wc.add_library(library)
if show:
wc.add_show(show)
- logger.info(f"Syncing Show: {show}")
if movie:
wc.add_movie(movie)
- logger.info(f"Syncing Movie: {movie}")
if not wc.is_valid():
click.echo("Nothing to sync, this is likely due conflicting options given.")

MODIFY
plextraktsync/walker.py
plextraktsync/walker.py
from typing import List, NamedTuple
+from plextraktsync.logging import logging
from plextraktsync.decorators.deprecated import deprecated
from plextraktsync.decorators.measure_time import measure_time
from plextraktsync.decorators.memoize import memoize
@@ -19,20 +20,25 @@ class WalkConfig:
def __init__(self, movies=True, shows=True):
self.walk_movies = movies
self.walk_shows = shows
+ self.logger = logging.getLogger('PlexTraktSync.WalkConfig')
def add_library(self, library):
self.library.append(library)
+ self.logger.info(f"Filtering Library: {library}")
def add_id(self, id):
self.id.append(id)
+ self.logger.info(f"Syncing item: {id}")
def add_show(self, show):
self.show.append(show)
self.walk_movies = False
+ self.logger.info(f"Syncing Show: {show}")
def add_movie(self, movie):
self.movie.append(movie)
self.walk_shows = False
+ self.logger.info(f"Syncing Movie: {movie}")
def is_valid(self):
# Single item provided

Move logging messages to WalkConfig