Add indent of elapsed time

This commit is contained in:
iory 2020-04-18 09:28:33 +09:00 committed by Ram Rachum
parent b886f2b504
commit 4779aebbe4

View file

@ -318,7 +318,9 @@ class Tracer:
start_time = self.start_times.pop(id(calling_frame))
duration = datetime_module.datetime.now() - start_time
now_string = pycompat.timedelta_isoformat(duration, timespec='microseconds')
self.write('Total elapsed time: {now_string}'.format(**locals()))
indent = ' ' * 4 * (thread_global.depth + 1)
self.write('{indent}Total elapsed time: {now_string}'.format(
**locals()))
def _is_internal_frame(self, frame):
return frame.f_code.co_filename == Tracer.__enter__.__code__.co_filename