Adding debug

This commit is contained in:
Anton Hvornum 2022-02-09 14:50:32 +01:00
parent 1fdb64858c
commit 2992849de8
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 5 additions and 2 deletions

View File

@ -223,8 +223,11 @@ class SysCommandWorker:
"""
assert type(key) == bytes
if (contains := key in self._trace_log[self._trace_log_pos:]):
self._trace_log_pos += self._trace_log[self._trace_log_pos:].find(key) + len(key)
with open('./debug.txt', 'a') as silent_output:
silent_output.write(f"Checking for {[key]} in {[self._trace_log]} as position {self._trace_log_pos}\n")
if (contains := key in self._trace_log[self._trace_log_pos:]):
silent_output.write(f" -Found it at {self._trace_log.find(key, self._trace_log_pos)}\n")
self._trace_log_pos += self._trace_log.find(key, self._trace_log_pos) + len(key)
return contains