fix: 로그 복사·저장이 화면 줄 수 제한(5000줄)에 걸려 앞부분을 잃던 것
Some checks failed
Windows / verify (push) Has been cancelled
Some checks failed
Windows / verify (push) Has been cancelled
화면은 최근 5000줄만 들고 있는데 복사·저장도 그 버퍼를 썼다. 오래 켜 두면 원인 찾기에 가장 필요한 시작 부분(GPU 준비·모델 로드)이 내보낸 로그에서 빠졌다. 내보내기는 이번 실행이 livesub.log 에 쓴 부분을 파일에서 다시 읽고, 저장 위치를 고르기 전의 줄을 앞에 붙인다. 파일을 못 쓰는 환경에서만 화면 버퍼로 돌아간다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,9 @@ class LogPage(QWidget):
|
||||
self.save_button = QPushButton("파일로 저장")
|
||||
self.save_button.clicked.connect(self._save_dialog)
|
||||
self.clear_button = QPushButton("화면 비우기")
|
||||
self.clear_button.setToolTip("이 화면만 비웁니다. livesub.log 파일은 그대로 둡니다.")
|
||||
self.clear_button.setToolTip(
|
||||
"이 화면만 비웁니다. 복사·저장에는 이번 실행 기록이 전부 그대로 들어갑니다."
|
||||
)
|
||||
self.clear_button.clicked.connect(self.clear)
|
||||
for button in (self.copy_button, self.save_button, self.clear_button):
|
||||
row.addWidget(button)
|
||||
@@ -102,11 +104,12 @@ class LogPage(QWidget):
|
||||
f"저장 위치 {user_data_dir()} · 기록 시각 {datetime.now():%Y-%m-%d %H:%M:%S}",
|
||||
"-" * 60,
|
||||
]
|
||||
return "\n".join(header) + "\n" + self.buffer.text() + "\n"
|
||||
return "\n".join(header) + "\n" + self.buffer.full_text() + "\n"
|
||||
|
||||
def copy_to_clipboard(self) -> None:
|
||||
QGuiApplication.clipboard().setText(self.report())
|
||||
self.notice.setText(f"{len(self.buffer.lines())}줄을 복사했습니다")
|
||||
text = self.report()
|
||||
QGuiApplication.clipboard().setText(text)
|
||||
self.notice.setText(f"{text.count(chr(10))}줄을 복사했습니다")
|
||||
|
||||
def save_to(self, path: str) -> None:
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
|
||||
Reference in New Issue
Block a user