From 3a4a925ab07b1a91cc63184fc3198917f7baa854 Mon Sep 17 00:00:00 2001 From: Safihre Date: Mon, 1 Feb 2021 13:40:13 +0100 Subject: [PATCH] Restore "--console" command line switch Closes #1775 --- SABnzbd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SABnzbd.py b/SABnzbd.py index f7e7b9e..7e53453 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -195,6 +195,7 @@ def print_help(): print(" --no-login Start with username and password reset") print(" --log-all Log all article handling (for developers)") print(" --disable-file-log Logging is only written to console") + print(" --console Force logging to console") print(" --new Run a new instance of SABnzbd") print() print("NZB (or related) file:") @@ -845,6 +846,7 @@ def main(): cherrypylogging = None clean_up = False logging_level = None + console_logging = False no_file_log = False web_dir = None vista_plus = False @@ -900,6 +902,8 @@ def main(): if logging_level < -1 or logging_level > 2: print_help() exit_sab(1) + elif opt == "--console": + console_logging = True elif opt in ("-v", "--version"): print_version() exit_sab(0) @@ -941,8 +945,8 @@ def main(): sabnzbd.DIR_LANGUAGE = real_path(sabnzbd.DIR_PROG, DEF_LANGUAGE) org_dir = os.getcwd() - # Need console logging for SABnzbd.py and SABnzbd-console.exe - console_logging = (not hasattr(sys, "frozen")) or (sabnzbd.MY_NAME.lower().find("-console") > 0) + # Need console logging if requested, for SABnzbd.py and SABnzbd-console.exe + console_logging = console_logging or sabnzbd.MY_NAME.lower().find("-console") > 0 or not hasattr(sys, "frozen") console_logging = console_logging and not sabnzbd.DAEMON LOGLEVELS = (logging.FATAL, logging.WARNING, logging.INFO, logging.DEBUG)