From 9975dc6ba0398d2e402e0d295c25b6b7e85ea0eb Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Tue, 12 Sep 2023 10:36:00 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8D[Update]=20main=20logger=E3=81=AEca?= =?UTF-8?q?llback=E3=82=92=E8=A8=AD=E5=AE=9A/=E7=BF=BB=E8=A8=B3=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E3=82=8F=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AB?= =?UTF-8?q?=E7=BF=BB=E8=A8=B3=E9=83=A8=E5=88=86=E3=81=AE()=E3=82=92log?= =?UTF-8?q?=E3=81=AB=E6=AE=8B=E3=81=95=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 7e049c3f..e830b054 100644 --- a/main.py +++ b/main.py @@ -33,7 +33,9 @@ def sendMicMessage(message): view.printToTextbox_SentMessage(message, translation) if config.ENABLE_LOGGER is True: - model.logger.info(f"[SEND] {message} ({translation})") + if len(translation) > 0: + translation = f" ({translation})" + model.logger.info(f"[SEND] {message}{translation}") def startTranscriptionSendMessage(): model.startMicTranscript(sendMicMessage) @@ -61,7 +63,9 @@ def receiveSpeakerMessage(message): model.notificationXSOverlay(xsoverlay_message) view.printToTextbox_ReceivedMessage(message, translation) if config.ENABLE_LOGGER is True: - model.logger.info(f"[RECEIVE] {message} ({translation})") + if len(translation) > 0: + translation = f" ({translation})" + model.logger.info(f"[RECEIVE] {message}{translation}") def startTranscriptionReceiveMessage(): model.startSpeakerTranscript(receiveSpeakerMessage) @@ -97,7 +101,9 @@ def sendChatMessage(message): # update textbox message log view.printToTextbox_SentMessage(message, translation) if config.ENABLE_LOGGER is True: - model.logger.info(f"[SEND] {message} ({translation})") + if len(translation) > 0: + translation = f" ({translation})" + model.logger.info(f"[SEND] {message}{translation}") # delete message in entry message box if config.ENABLE_AUTO_CLEAR_MESSAGE_BOX is True: @@ -386,6 +392,15 @@ def callbackSetEnableNoticeXsoverlay(value): print("callbackSetEnableNoticeXsoverlay", value) config.ENABLE_NOTICE_XSOVERLAY = value +def callbackSetEnableAutoExportMessageLogs(value): + print("callbackSetEnableAutoExportMessageLogs", value) + config.ENABLE_LOGGER = value + + if config.ENABLE_LOGGER is True: + model.startLogger() + else: + model.stopLogger() + def callbackSetMessageFormat(value): print("callbackSetMessageFormat", value) if len(value) > 0: @@ -487,6 +502,7 @@ view.register( # Others Tab "callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox, "callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay, + "callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs, "callback_set_message_format": callbackSetMessageFormat, # Advanced Settings Tab