File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22### Default values
3- scriptVersion="1.4 "
3+ scriptVersion="1.5 "
44scriptName="ARLChecker"
55sleepInterval='24h'
66### Import Settings
Original file line number Diff line number Diff line change 33from dataclasses import dataclass
44from requests import Session
55from argparse import ArgumentParser
6- from sys import argv
6+ from sys import argv , stdout
77from colorama import Fore , init
88from telegram import Update
99from telegram .ext import ApplicationBuilder , ContextTypes , CommandHandler
1717 if 'scriptVersion' in line :
1818 VERSION = re .search (r'"([A-Za-z0-9_\./\\-]*)"' , line )[0 ].replace ('"' ,'' )
1919
20+ # Get current log file
21+ path = '/config/logs'
22+ latest_file = max ([os .path .join (path , f ) for f in os .listdir (path ) if 'ARLChecker' in f ],key = os .path .getctime )
2023
2124# Logging Setup
2225logging .basicConfig (
2326 format = f'%(asctime)s :: ARLChecker :: { VERSION } :: %(levelname)s :: %(message)s' ,
2427 datefmt = '%Y-%m-%d %H:%M:%S' ,
25- level = logging .INFO
28+ level = logging .INFO ,
29+ handlers = [
30+ logging .StreamHandler (stdout ),
31+ logging .FileHandler (latest_file , mode = "a" )
32+ ]
2633)
2734logger = logging .getLogger (__name__ )
2835
You can’t perform that action at this time.
0 commit comments