Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
fix #107
Browse files Browse the repository at this point in the history
  • Loading branch information
xbot authored and megachweng committed Jul 18, 2022
1 parent 2ad9c17 commit 5747648
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addon/addonWindow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import sys
import logging
import json
from copy import deepcopy
from tempfile import gettempdir

from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QPlainTextEdit, QDialog, QListWidgetItem, QVBoxLayout, QPushButton
Expand Down Expand Up @@ -97,7 +99,8 @@ def onDestroyed():
logger.removeHandler(QtHandler)

# 防止 debug 信息写入stdout/stderr 导致 Anki 崩溃
logging.basicConfig(handlers=[logging.FileHandler('dict2anki.log', 'w', 'utf-8')], level=logging.DEBUG, format='[%(asctime)s][%(levelname)8s] -- %(message)s - (%(name)s)')
logFile = os.path.join(gettempdir(), 'dict2anki.log')
logging.basicConfig(handlers=[logging.FileHandler(logFile, 'w', 'utf-8')], level=logging.DEBUG, format='[%(asctime)s][%(levelname)8s] -- %(message)s - (%(name)s)')

logTextBox = QPlainTextEdit(self)
logTextBox.setLineWrapMode(QPlainTextEdit.NoWrap)
Expand Down

0 comments on commit 5747648

Please sign in to comment.