File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
### Default values
3
- scriptVersion="1.4 "
3
+ scriptVersion="1.5 "
4
4
scriptName="ARLChecker"
5
5
sleepInterval='24h'
6
6
### Import Settings
Original file line number Diff line number Diff line change 3
3
from dataclasses import dataclass
4
4
from requests import Session
5
5
from argparse import ArgumentParser
6
- from sys import argv
6
+ from sys import argv , stdout
7
7
from colorama import Fore , init
8
8
from telegram import Update
9
9
from telegram .ext import ApplicationBuilder , ContextTypes , CommandHandler
17
17
if 'scriptVersion' in line :
18
18
VERSION = re .search (r'"([A-Za-z0-9_\./\\-]*)"' , line )[0 ].replace ('"' ,'' )
19
19
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 )
20
23
21
24
# Logging Setup
22
25
logging .basicConfig (
23
26
format = f'%(asctime)s :: ARLChecker :: { VERSION } :: %(levelname)s :: %(message)s' ,
24
27
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
+ ]
26
33
)
27
34
logger = logging .getLogger (__name__ )
28
35
You can’t perform that action at this time.
0 commit comments