change logging format to %

This commit is contained in:
2024-06-28 20:08:08 +08:00
parent fe3f610878
commit 0c88302053
8 changed files with 43 additions and 30 deletions

View File

@ -6,10 +6,10 @@ from arcaea_offline_ocr.b30.chieri.v4.ocr import ChieriBotV4Ocr
from arcaea_offline_ocr.b30.shared import B30OcrResultItem
from PySide6.QtGui import QImage
logger = logging.getLogger(__name__)
from ui.extends.components.ocrQueue import OcrRunnable
logger = logging.getLogger(__name__)
class ChieriV4OcrRunnable(OcrRunnable):
def __init__(self, ocr: ChieriBotV4Ocr, component):

View File

@ -41,7 +41,7 @@ class AndrealExecuteRunnable(QRunnable):
self.signals.completed.emit(self.jsonPath, imageBytes)
except Exception as e:
imageBytes = None
logger.exception(f"{self.__class__.__name__} error")
logger.exception("%s error", self.__class__.__name__)
self.signals.error.emit(self.jsonPath, str(e))
finally:
os.unlink(self.jsonPath)
@ -84,7 +84,10 @@ class AndrealHelper(QObject):
def request(self, jsonPath: str, arguments: list[str]):
logger.debug(
f"{self.__class__.__name__} received request {jsonPath=} {arguments=}"
"%s received request jsonPath=%r arguments=%r",
self.__class__.__name__,
jsonPath,
arguments,
)
runnable = AndrealExecuteRunnable(self.andrealExecutable, jsonPath, arguments)
runnable.signals.error.connect(self.error)