mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
tcp: clear_log to clear socket logs
This commit is contained in:
parent
113c5c187f
commit
4ca62e0d9b
@ -126,6 +126,9 @@ class _FileLike(object):
|
||||
if self.is_logging():
|
||||
self._log.append(v)
|
||||
|
||||
def clear_log(self):
|
||||
self._log = []
|
||||
|
||||
def reset_timestamps(self):
|
||||
self.first_byte_timestamp = None
|
||||
|
||||
|
@ -553,6 +553,8 @@ class TestFileLike:
|
||||
assert s.get_log() == ""
|
||||
s.read(1)
|
||||
assert s.get_log() == "o"
|
||||
s.clear_log()
|
||||
assert s.get_log() == ""
|
||||
s.stop_log()
|
||||
tutils.raises(ValueError, s.get_log)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user