diff --git a/changelog.txt b/changelog.txt index fb8c720..cf5a027 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +=== 1.3.3 === +- Swapped logging library + +=== 1.3.2 === +- Tabulate import fix + === 1.3.1 === - Magnet url fix diff --git a/raincoat/raincoat.py b/raincoat/raincoat.py index 6a9d1a1..9cfbf18 100644 --- a/raincoat/raincoat.py +++ b/raincoat/raincoat.py @@ -1,15 +1,14 @@ import argparse import colorama import requests -import justlog +import logging import json import os +import sys from raincoat import shared from .helpers import greet, get_torrent_by_id, fetch_torrent_url from tabulate import tabulate from .torrent import torrent, filter_out, transmission, deluge, qbittorrent, local -from justlog import justlog, settings -from justlog.classes import Severity, Output, Format from .config import load_config from pathlib import Path from urllib3.exceptions import InsecureRequestWarning @@ -54,14 +53,12 @@ # Setup logger -logger = justlog.Logger(settings.Settings()) -logger.settings.colorized_logs = True -logger.settings.log_output = [Output.FILE] -logger.settings.log_format = Format.TEXT -logger.settings.log_file = f"{str(Path.home())}/.config/{shared.APP_NAME}.log" -logger.settings.update_field("timestamp", "$TIMESTAMP") -logger.settings.update_field("level", "$CURRENT_LOG_LEVEL") -logger.settings.string_format = "[ $timestamp ] :: $CURRENT_LOG_LEVEL :: $message" +logger = logging.getLogger("raincoat") +logger.setLevel(logging.DEBUG) +console = logging.StreamHandler(sys.stdout) +formatter = logging.Formatter('%(asctime)s | %(levelname)s | %(filename)s - %(message)s', datefmt='%y-%m-%d,%H:%M:%S') +console.setFormatter(formatter) +logger.addHandler(console) logger.debug(f"{shared.APP_NAME} v{shared.VERSION}") greet(shared.VERSION) diff --git a/raincoat/shared.py b/raincoat/shared.py index bd10b25..2633838 100644 --- a/raincoat/shared.py +++ b/raincoat/shared.py @@ -1,7 +1,7 @@ # Globals def init(): global VERSION - VERSION = "1.3.1" + VERSION = "1.3.3" global APP_NAME APP_NAME = "Raincoat" global TORRENTS diff --git a/setup.py b/setup.py index 45e90e9..15b8b47 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def run(self): keywords="transmission qbittorrent deluge jackett torrent", long_description=long_description, long_description_content_type="text/markdown", - python_requires=">=3.6", + python_requires=">=3.7.17", packages=setuptools.find_packages(), entry_points = { "console_scripts": ['raincoat = raincoat.raincoat:main'] @@ -54,7 +54,7 @@ def run(self): "Operating System :: Unix", "Topic :: Communications :: File Sharing", ], - install_requires=["requests==2.23.0", "justlog", "colorama==0.4.3", "tabulate==0.8.10", "transmission-clutch==6.0.2", "deluge-client==1.8.0", "python-qbittorrent==0.4.2"], + install_requires=["requests==2.23.0", "colorama==0.4.3", "tabulate==0.8.10", "transmission-clutch==6.0.2", "deluge-client==1.8.0", "python-qbittorrent==0.4.2"], cmdclass={ 'install': PostInstallCommand },