log start and end times

This commit is contained in:
AJ
2022-02-09 08:23:31 -05:00
parent fe019d6fb7
commit 3f94364416

View File

@@ -1,5 +1,6 @@
import qbittorrentapi
import time
import datetime
# instantiate a Client using the appropriate WebUI configuration
qbt_client = qbittorrentapi.Client(
@@ -40,6 +41,15 @@ def update_seed_count():
print('Waiting 30 seconds for seeds to update...')
time.sleep(30)
logfile = open(r"log.txt", "a")
def log(msg):
logfile.write('[{}] {}\n'.format(datetime.datetime.now(), msg))
logfile.flush()
print(msg)
log("starting")
login()
update_seed_count()
dostuff()
log("done")