Skip to content

Commit

Permalink
Swapped logging library
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabisonfire committed Mar 27, 2024
1 parent e527eba commit 728774c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
=== 1.3.3 ===
- Swapped logging library

=== 1.3.2 ===
- Tabulate import fix

=== 1.3.1 ===
- Magnet url fix

Expand Down
19 changes: 8 additions & 11 deletions raincoat/raincoat.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion raincoat/shared.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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
},
Expand Down

0 comments on commit 728774c

Please sign in to comment.