Fix debug log formatting
This commit is contained in:
1 parent
bbea5452b6
commit
ca96b5a799
1 file changed
+7
-3
@@ -428,7 +428,7 @@ class Twitch:
|
|||||||
context = await self.gql_request(GQL_OPERATIONS["CurrentDrop"])
|
context = await self.gql_request(GQL_OPERATIONS["CurrentDrop"])
|
||||||
drop_data: JsonType = context["data"]["currentUser"]["dropCurrentSession"]
|
drop_data: JsonType = context["data"]["currentUser"]["dropCurrentSession"]
|
||||||
with open("log.txt", 'a') as file:
|
with open("log.txt", 'a') as file:
|
||||||
print(format(time(), ".6f"), attempt+1, drop_data["dropID"], file=file)
|
print(format(time(), ".6f"), drop_data["dropID"], attempt+1, file=file)
|
||||||
if drop_data["dropID"] != drop.id:
|
if drop_data["dropID"] != drop.id:
|
||||||
self.restart_watching()
|
self.restart_watching()
|
||||||
break
|
break
|
||||||
@@ -677,10 +677,14 @@ class Twitch:
|
|||||||
drop_data = context["data"]["currentUser"]["dropCurrentSession"]
|
drop_data = context["data"]["currentUser"]["dropCurrentSession"]
|
||||||
with open("log.txt", 'a') as file:
|
with open("log.txt", 'a') as file:
|
||||||
if drop_data is None:
|
if drop_data is None:
|
||||||
print(time(), None, sep='\t', file=file, flush=True)
|
print(format(time(), ".6f"), None, sep='\t', file=file, flush=True)
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
time(), drop_data.get("currentMinutesWatched"), sep='\t', file=file, flush=True
|
format(time(), ".6f"),
|
||||||
|
drop_data.get("currentMinutesWatched"),
|
||||||
|
sep='\t',
|
||||||
|
file=file,
|
||||||
|
flush=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_drop(self, drop_id: str) -> Optional[TimedDrop]:
|
def get_drop(self, drop_id: str) -> Optional[TimedDrop]:
|
||||||
|
|||||||
Reference in new issue
Block a user