From 96f543aa29452d175e4e8fc4ae9f347d4f751428 Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 28 Apr 2014 15:22:44 -0700 Subject: [PATCH] Added debug option to config.ini to allow logging of debug messages to console output. --- sickbeard/__init__.py | 7 +++++-- sickbeard/logger.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 91b1d1c6..461d4970 100644 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -132,6 +132,7 @@ ACTUAL_CACHE_DIR = None ROOT_DIRS = None UPDATE_SHOWS_ON_START = None SORT_ARTICLE = None +DEBUG = False USE_LISTVIEW = None METADATA_XBMC = None @@ -497,8 +498,7 @@ def initialize(consoleLogging=True): GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, \ METADATA_WDTV, METADATA_TIVO, IGNORE_WORDS, CALENDAR_UNPROTECTED, CREATE_MISSING_SHOW_DIRS, \ ADD_SHOWS_WO_DIR, USE_SUBTITLES, SUBTITLES_LANGUAGES, SUBTITLES_DIR, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_HISTORY, SUBTITLES_FINDER_FREQUENCY, subtitlesFinderScheduler, \ - USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, \ - PROXY_SETTING + USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING if __INITIALIZED__: return False @@ -563,6 +563,8 @@ def initialize(consoleLogging=True): USE_API = bool(check_setting_int(CFG, 'General', 'use_api', 0)) API_KEY = check_setting_str(CFG, 'General', 'api_key', '') + DEBUG = bool(check_setting_int(CFG, 'General', 'debug', 0)) + ENABLE_HTTPS = bool(check_setting_int(CFG, 'General', 'enable_https', 0)) HTTPS_CERT = check_setting_str(CFG, 'General', 'https_cert', 'server.crt') @@ -1299,6 +1301,7 @@ def save_config(): new_config['General']['anon_redirect'] = ANON_REDIRECT new_config['General']['use_api'] = int(USE_API) new_config['General']['api_key'] = API_KEY + new_config['General']['debug'] = int(DEBUG) new_config['General']['enable_https'] = int(ENABLE_HTTPS) new_config['General']['https_cert'] = HTTPS_CERT new_config['General']['https_key'] = HTTPS_KEY diff --git a/sickbeard/logger.py b/sickbeard/logger.py index 32156b72..37319ac0 100644 --- a/sickbeard/logger.py +++ b/sickbeard/logger.py @@ -99,6 +99,8 @@ class SBRotatingLogHandler(object): console = logging.StreamHandler() console.setLevel(logging.INFO) + if sickbeard.DEBUG: + console.setLevel(logging.DEBUG) # set a format which is simpler for console use console.setFormatter(DispatchingFormatter(