diff --git a/src/video2x.py b/src/video2x.py index 1c30a22..3ceec07 100755 --- a/src/video2x.py +++ b/src/video2x.py @@ -121,7 +121,7 @@ def parse_arguments(): default=pathlib.Path(__file__).parent.absolute() / 'video2x.yaml') video2x_options.add_argument('--log', type=pathlib.Path, help=_('log file path'), default=pathlib.Path(__file__).parent.absolute() / f'video2x_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.log') - video2x_options.add_argument('--nolog', help=_('disable logging'), action='store_true') + video2x_options.add_argument('--disable_logging', help=_('disable logging'), action='store_true') video2x_options.add_argument('-v', '--version', help=_('display version, lawful information and exit'), action='store_true') # scaling options @@ -184,7 +184,7 @@ if video2x_args.version: sys.exit(0) # redirect output to both terminal and log file -if video2x_args.nolog is False: +if video2x_args.disable_logging is False: LOGFILE = video2x_args.log Avalon.debug_info(_('Redirecting console logs to {}').format(LOGFILE)) sys.stdout = BiLogger(sys.stdout, LOGFILE) diff --git a/src/video2x_gui.py b/src/video2x_gui.py index 6de7ce3..ba0983b 100755 --- a/src/video2x_gui.py +++ b/src/video2x_gui.py @@ -17,7 +17,6 @@ from wrappers.ffmpeg import Ffmpeg import contextlib import datetime import json -import math import mimetypes import os import pathlib @@ -281,6 +280,7 @@ class Video2XMainWindow(QMainWindow): self.image_output_extension_line_edit = self.findChild(QLineEdit, 'imageOutputExtensionLineEdit') self.video_output_extension_line_edit = self.findChild(QLineEdit, 'videoOutputExtensionLineEdit') self.preserve_frames_check_box = self.findChild(QCheckBox, 'preserveFramesCheckBox') + self.disable_logging_check_box = self.findChild(QCheckBox, 'disableLoggingCheckBox') # frame preview self.frame_preview_show_preview_check_box = self.findChild(QCheckBox, 'framePreviewShowPreviewCheckBox') @@ -1154,9 +1154,10 @@ It\'s also highly recommended for you to attach the [log file]({}) under the pro self.show_warning('Output path unspecified') return - print(f'Redirecting console logs to {self.logfile}', file=sys.stderr) - sys.stdout = BiLogger(sys.stdout, self.logfile) - sys.stderr = BiLogger(sys.stderr, self.logfile) + if self.disable_logging_check_box.isChecked() is False: + print(f'Redirecting console logs to {self.logfile}', file=sys.stderr) + sys.stdout = BiLogger(sys.stdout, self.logfile) + sys.stderr = BiLogger(sys.stderr, self.logfile) if len(self.input_table_data) == 1: input_directory = self.input_table_data[0] diff --git a/src/video2x_gui.pyproject.user b/src/video2x_gui.pyproject.user index e87e316..e5b51a5 100644 --- a/src/video2x_gui.pyproject.user +++ b/src/video2x_gui.pyproject.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -170,7 +170,7 @@ false true - + C:/Users/k4yt3x/Documents/Projects/video2x/src 1 diff --git a/src/video2x_gui.ui b/src/video2x_gui.ui index 5d54add..ccb57b4 100644 --- a/src/video2x_gui.ui +++ b/src/video2x_gui.ui @@ -7,7 +7,7 @@ 0 0 673 - 876 + 910 @@ -468,6 +468,13 @@ + + + + Disable Logging + + +