Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 7dd83bb

Browse files
committed
fix: 修复日志格式混乱
1 parent d0cb900 commit 7dd83bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def __init__(self, *args, **kwargs):
1616
def log(self, *args, **kwargs):
1717
super().log(*args, **kwargs)
1818
if not self.log_file.closed:
19-
self.log_file.write(" ".join(map(str, args)) + "\n")
19+
self.log_file.write("\n"+" ".join(map(str, args)) + "\n")
2020

2121
def print(self, *args, **kwargs):
2222
super().print(*args, **kwargs)
2323
captured_output_value = super().export_text()
2424
if not self.log_file.closed:
25-
self.log_file.write(captured_output_value)
25+
self.log_file.write("\n"+captured_output_value+"\n")
2626

2727
def cleanup(self):
2828
if not self.log_file.closed:
@@ -33,7 +33,7 @@ def __del__(self):
3333

3434

3535
def main():
36-
console = MyConsole(width=__SCREEN_WIDTH__,record=True)
36+
console = MyConsole(width=__SCREEN_WIDTH__, record=True)
3737
install(console=console, show_locals=True, width=__SCREEN_WIDTH__)
3838

3939
try:

0 commit comments

Comments
 (0)