chore: Refactor Step class to improve logging of step duration

This commit is contained in:
bobo 2024-05-18 14:55:17 +08:00
parent 53dc01015f
commit fa8058b5ff

View File

@ -1,8 +1,9 @@
from contextlib import AbstractContextManager
import time
from contextlib import AbstractContextManager
from lib.ide_service import IDEService
class Step(AbstractContextManager):
"""
Show a running step in the TUI.
@ -30,7 +31,6 @@ class Step(AbstractContextManager):
# close the step
end_time = time.time()
IDEService().ide_logging(
"debug",
f"Step {self.title} took {end_time - self.enter_time:.2f} seconds"
"debug", f"Step {self.title} took {end_time - self.enter_time:.2f} seconds"
)
print("\n```", flush=True)