mirror of
https://github.com/k4yt3x/video2x.git
synced 2025-01-04 04:39:10 +00:00
added disable logging check box
This commit is contained in:
parent
7e87dac15e
commit
60cf792c23
@ -121,7 +121,7 @@ def parse_arguments():
|
|||||||
default=pathlib.Path(__file__).parent.absolute() / 'video2x.yaml')
|
default=pathlib.Path(__file__).parent.absolute() / 'video2x.yaml')
|
||||||
video2x_options.add_argument('--log', type=pathlib.Path, help=_('log file path'),
|
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')
|
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')
|
video2x_options.add_argument('-v', '--version', help=_('display version, lawful information and exit'), action='store_true')
|
||||||
|
|
||||||
# scaling options
|
# scaling options
|
||||||
@ -184,7 +184,7 @@ if video2x_args.version:
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# redirect output to both terminal and log file
|
# 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
|
LOGFILE = video2x_args.log
|
||||||
Avalon.debug_info(_('Redirecting console logs to {}').format(LOGFILE))
|
Avalon.debug_info(_('Redirecting console logs to {}').format(LOGFILE))
|
||||||
sys.stdout = BiLogger(sys.stdout, LOGFILE)
|
sys.stdout = BiLogger(sys.stdout, LOGFILE)
|
||||||
|
@ -17,7 +17,6 @@ from wrappers.ffmpeg import Ffmpeg
|
|||||||
import contextlib
|
import contextlib
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import math
|
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
@ -281,6 +280,7 @@ class Video2XMainWindow(QMainWindow):
|
|||||||
self.image_output_extension_line_edit = self.findChild(QLineEdit, 'imageOutputExtensionLineEdit')
|
self.image_output_extension_line_edit = self.findChild(QLineEdit, 'imageOutputExtensionLineEdit')
|
||||||
self.video_output_extension_line_edit = self.findChild(QLineEdit, 'videoOutputExtensionLineEdit')
|
self.video_output_extension_line_edit = self.findChild(QLineEdit, 'videoOutputExtensionLineEdit')
|
||||||
self.preserve_frames_check_box = self.findChild(QCheckBox, 'preserveFramesCheckBox')
|
self.preserve_frames_check_box = self.findChild(QCheckBox, 'preserveFramesCheckBox')
|
||||||
|
self.disable_logging_check_box = self.findChild(QCheckBox, 'disableLoggingCheckBox')
|
||||||
|
|
||||||
# frame preview
|
# frame preview
|
||||||
self.frame_preview_show_preview_check_box = self.findChild(QCheckBox, 'framePreviewShowPreviewCheckBox')
|
self.frame_preview_show_preview_check_box = self.findChild(QCheckBox, 'framePreviewShowPreviewCheckBox')
|
||||||
@ -1154,6 +1154,7 @@ It\'s also highly recommended for you to attach the [log file]({}) under the pro
|
|||||||
self.show_warning('Output path unspecified')
|
self.show_warning('Output path unspecified')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.disable_logging_check_box.isChecked() is False:
|
||||||
print(f'Redirecting console logs to {self.logfile}', file=sys.stderr)
|
print(f'Redirecting console logs to {self.logfile}', file=sys.stderr)
|
||||||
sys.stdout = BiLogger(sys.stdout, self.logfile)
|
sys.stdout = BiLogger(sys.stdout, self.logfile)
|
||||||
sys.stderr = BiLogger(sys.stderr, self.logfile)
|
sys.stderr = BiLogger(sys.stderr, self.logfile)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.12.0, 2020-06-07T15:25:44. -->
|
<!-- Written by QtCreator 4.12.0, 2020-06-07T23:58:53. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
@ -170,7 +170,7 @@
|
|||||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/k4yt3x/Documents/Projects/video2x/src</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>673</width>
|
<width>673</width>
|
||||||
<height>876</height>
|
<height>910</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="acceptDrops">
|
<property name="acceptDrops">
|
||||||
@ -468,6 +468,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disableLoggingCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Logging</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user