Move log file path to path module
MODIFY
plex_trakt_sync/main.py
plex_trakt_sync/main.py
import plexapi.server
-from os import path
import trakt
-from plex_trakt_sync.path import pytrakt_file, env_file
+from plex_trakt_sync.path import pytrakt_file, env_file, log_file
trakt.core.CONFIG_PATH = pytrakt_file
import trakt.movies
import trakt.tv
@@ -398,9 +397,8 @@ def main():
start_time = time()
logLevel = logging.DEBUG if CONFIG['log_debug_messages'] else logging.INFO
- logfile = path.join(path.dirname(path.abspath(__file__)), "last_update.log")
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s',
- handlers=[logging.FileHandler(logfile, 'w', 'utf-8')],
+ handlers=[logging.FileHandler(log_file, 'w', 'utf-8')],
level=logLevel)
listutil = TraktListUtil()
# do not use the cache for account specific stuff as this is subject to change

MODIFY
plex_trakt_sync/path.py
plex_trakt_sync/path.py
config_file = join(app_path, "config.json")
pytrakt_file = join(app_path, ".pytrakt.json")
env_file = join(app_path, ".env")
+log_file = join(app_path, "last_update.log")

Move log file path to path module