Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion control_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def stop_main(self):
def update_log_view(self):
"""实时更新日志显示"""
try:
with open('logs/app.log', 'r') as f:
with open('logs/app.log', 'r', encoding='utf-8') as f:
# 跳转到上次读取位置
f.seek(self._log_file_pos)

Expand Down
3 changes: 2 additions & 1 deletion src/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def setup_logger():
file_handler = RotatingFileHandler(
'logs/app.log',
maxBytes=1024*1024, # 1MB
backupCount=5
backupCount=5,
encoding='utf-8'
)
file_handler.setFormatter(logging.Formatter(
'%(asctime)s - %(levelname)s - %(message)s'
Expand Down