diff --git a/CHANGES.md b/CHANGES.md
index 6a6aa66f..6fd5b307 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -88,6 +88,7 @@
* Change code re-factored in readiness for live option switching, clean up and add closures of html tables
* Add show overview from indexers to the database
* Fix case where start year or runtime is not available to display show
+* Add "File logging level" to General Config/Advanced Settings
[develop changelog]
* Fix traceback error when using the menu item Manage/Update Kodi
diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl
index d74e2523..6cd9e73a 100644
--- a/gui/slick/interfaces/default/config_general.tmpl
+++ b/gui/slick/interfaces/default/config_general.tmpl
@@ -8,6 +8,8 @@
#from sickbeard import metadata
#from sickbeard.metadata.generic import GenericMetadata
#from sickbeard.helpers import anon_url
+#from sickbeard.logger import reverseNames as file_logging_presets
+#from sickbeard.helpers import maybe_plural
#set global $title = 'Config - General'
#set global $header = 'General Configuration'
@@ -22,6 +24,8 @@
#else
$title
#end if
+#set $checked = ' checked="checked"'
+#set $selected = ' selected="selected"'
#set $indexer = 0
#if $sickbeard.INDEXER_DEFAULT
@@ -57,7 +61,7 @@
Launch browser
-
+
open the SickGear home page on startup
@@ -67,7 +71,7 @@
Update shows on startup
-
+
with show data; episode plot, images, air and end dates, etc. Disable for a quicker startup. Show data is scheduled to update during hour $sickbeard.SHOW_UPDATE_HOUR .
@@ -87,11 +91,11 @@
Send to trash for actions
-
+
when using show "Remove" and delete files
-
+
on scheduled deletes of the oldest log files
selected actions use trash (recycle bin) instead of the default permanent delete
@@ -112,9 +116,9 @@
Use initial indexer set to
- All Indexers
+ All Indexers
#for $indexer in $sickbeard.indexerApi().indexers
- $sickbeard.indexerApi().indexers[$indexer]
+ $sickbeard.indexerApi().indexers[$indexer]
#end for
as the default selection when adding new shows
@@ -157,7 +161,7 @@
Check software updates
-
+
and display notifications when updates are available.
Checks are run on startup and at the frequency set below*
@@ -168,7 +172,7 @@
Automatically update
-
+
fetch and install software updates.
Updates are run on startup and in the background at the frequency set below*
@@ -189,7 +193,7 @@
Notify on software update
-
+
send a message to all enabled notifiers when SickGear has been updated
@@ -217,8 +221,8 @@
Display theme:
- Dark
- Light
+ Dark
+ Light
for appearance to take effect, save then refresh your browser
@@ -230,9 +234,9 @@
Use as default home page:
- Shows
- Episodes
- History
+ Shows
+ Episodes
+ History
@@ -242,7 +246,7 @@
Enable IMDb info
-
+
for ui links, display show; ratings, country flag, year, runtime, and genre tags
@@ -252,7 +256,7 @@
Give show list search focus
-
+
page refresh on "Show List" will start search box focused
@@ -262,7 +266,7 @@
Sort with "The", "A", "An"
-
+
include articles ("The", "A", "An") when sorting show lists
@@ -272,16 +276,16 @@
Display fuzzy dates
-
+
move absolute dates into tooltips and display e.g. "Last Thu", "On Tue"
-
-#if $sickbeard.BRANCH != 'master':
+#if $sickbeard.BRANCH != 'master'
@@ -589,12 +595,33 @@
Use proxy for indexers
-
+
use proxy host for connecting to indexers (thetvdb, tvrage)
+
+
+ File logging level:
+
+
+#set $levels = $file_logging_presets.keys()
+#set void = $levels.sort(lambda x, y: cmp($file_logging_presets[$x], $file_logging_presets[$y]))
+#set $level_count = len($levels)
+#for $level in $levels
+ #set $level_title = $level.title().upper()
+ #set $level_count -= 1
+ #set $level_text = '%s%s' % ($level.title(), (('', ' only')[0 == $level_count], ' and the next%s level%s' % ((' ' + str($level_count), '')[1 == $level_count], maybe_plural($level_count)))[0 < $level_count])
+ $level_text
+#end for
+
+ (default: Db)
+ enable Db or Debug to pin down an issue, the others are normal use
+
+
+
+
@@ -613,8 +640,8 @@
diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py
index 356c44df..4d3a56a0 100755
--- a/sickbeard/__init__.py
+++ b/sickbeard/__init__.py
@@ -116,6 +116,7 @@ started = False
ACTUAL_LOG_DIR = None
LOG_DIR = None
+FILE_LOGGING_PRESET = 'DB'
SOCKET_TIMEOUT = None
@@ -485,7 +486,7 @@ def get_backlog_cycle_time():
def initialize(consoleLogging=True):
with INIT_LOCK:
- global BRANCH, GIT_REMOTE, CUR_COMMIT_HASH, CUR_COMMIT_BRANCH, ACTUAL_LOG_DIR, LOG_DIR, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \
+ global BRANCH, GIT_REMOTE, CUR_COMMIT_HASH, CUR_COMMIT_BRANCH, ACTUAL_LOG_DIR, LOG_DIR, FILE_LOGGING_PRESET, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \
HANDLE_REVERSE_PROXY, USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, CHECK_PROPERS_INTERVAL, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, NZBGET_HOST, NZBGET_USE_HTTPS, backlogSearchScheduler, \
@@ -609,6 +610,8 @@ def initialize(consoleLogging=True):
if not helpers.makeDir(LOG_DIR):
logger.log(u"!!! No log folder, logging to screen only!", logger.ERROR)
+ FILE_LOGGING_PRESET = check_setting_str(CFG, 'General', 'file_logging_preset', 'DB')
+
SOCKET_TIMEOUT = check_setting_int(CFG, 'General', 'socket_timeout', 30)
socket.setdefaulttimeout(SOCKET_TIMEOUT)
@@ -1412,6 +1415,7 @@ def save_config():
new_config['General']['config_version'] = CONFIG_VERSION
new_config['General']['encryption_version'] = int(ENCRYPTION_VERSION)
new_config['General']['log_dir'] = ACTUAL_LOG_DIR if ACTUAL_LOG_DIR else 'Logs'
+ new_config['General']['file_logging_preset'] = FILE_LOGGING_PRESET if FILE_LOGGING_PRESET else 'DB'
new_config['General']['socket_timeout'] = SOCKET_TIMEOUT
new_config['General']['web_port'] = WEB_PORT
new_config['General']['web_host'] = WEB_HOST
diff --git a/sickbeard/logger.py b/sickbeard/logger.py
index 1149c1bd..43253f47 100644
--- a/sickbeard/logger.py
+++ b/sickbeard/logger.py
@@ -173,7 +173,7 @@ class SBRotatingLogHandler(object):
"""
file_handler = TimedCompressedRotatingFileHandler(self.log_file_path, when='midnight', backupCount=7, encoding='utf-8')
- file_handler.setLevel(DB)
+ file_handler.setLevel(reverseNames[sickbeard.FILE_LOGGING_PRESET])
file_handler.setFormatter(DispatchingFormatter(
{'sickbeard': logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', '%Y-%m-%d %H:%M:%S'),
'subliminal': logging.Formatter('%(asctime)s %(levelname)-8s SUBLIMINAL :: %(message)s',
@@ -303,4 +303,9 @@ def log_error_and_exit(error_msg):
def close():
- sb_log_instance.close_log()
\ No newline at end of file
+ sb_log_instance.close_log()
+
+
+def log_set_level():
+ if sb_log_instance.cur_handler:
+ sb_log_instance.cur_handler.setLevel(reverseNames[sickbeard.FILE_LOGGING_PRESET])
\ No newline at end of file
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index 4d7271a4..8083d6b2 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -3390,7 +3390,7 @@ class ConfigGeneral(Config):
def saveGeneral(self, log_dir=None, web_port=None, web_log=None, encryption_version=None, web_ipv6=None,
update_shows_on_start=None, show_update_hour=None, trash_remove_show=None, trash_rotate_logs=None, update_frequency=None, launch_browser=None, web_username=None,
- use_api=None, api_key=None, indexer_default=None, timezone_display=None, cpu_preset=None,
+ use_api=None, api_key=None, indexer_default=None, timezone_display=None, cpu_preset=None, file_logging_preset=None,
web_password=None, version_notify=None, enable_https=None, https_cert=None, https_key=None,
handle_reverse_proxy=None, home_search_focus=None, sort_article=None, auto_update=None, notify_on_update=None,
proxy_setting=None, proxy_indexers=None, anon_redirect=None, git_path=None, git_remote=None, calendar_unprotected=None,
@@ -3420,6 +3420,10 @@ class ConfigGeneral(Config):
sickbeard.DISPLAY_ALL_SEASONS = config.checkbox_to_value(display_all_seasons)
sickbeard.SORT_ARTICLE = config.checkbox_to_value(sort_article)
sickbeard.CPU_PRESET = cpu_preset
+ sickbeard.FILE_LOGGING_PRESET = file_logging_preset
+
+ logger.log_set_level()
+
sickbeard.ANON_REDIRECT = anon_redirect
sickbeard.PROXY_SETTING = proxy_setting
sickbeard.PROXY_INDEXERS = config.checkbox_to_value(proxy_indexers)