summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2013-11-17 17:44:28 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2013-11-17 17:44:28 +0100
commitfa8411d9e0775ebfe516a139d64b314d3c06c253 (patch)
tree2dd7060698e0118def9e34c85a7ea49af7893438
parentrestored multihoster overwritten by merge (diff)
downloadpyload-fa8411d9e0775ebfe516a139d64b314d3c06c253.tar.xz
Improved setting
-rw-r--r--pyload/Core.py14
-rw-r--r--pyload/config/default.py3
2 files changed, 9 insertions, 8 deletions
diff --git a/pyload/Core.py b/pyload/Core.py
index abcc328f3..d1989991f 100644
--- a/pyload/Core.py
+++ b/pyload/Core.py
@@ -522,12 +522,10 @@ class Core(object):
fh_frm = logging.Formatter(fhfmt, datefmt)
# console formatter
- if self.config['log']['console_color'] == "No":
- console_frm = fh_frm
- else:
+ if self.config['log']['console_color']:
from lib.colorlog import ColoredFormatter
- if self.config['log']['console_color'] == "Full":
+ if self.config['log']['color_theme'] == "full":
cfmt = "%(asctime)s %(log_color)s%(bold)s%(white)s %(levelname)+8s %(reset)s %(message)s"
clr = {
'DEBUG': 'bg_cyan',
@@ -536,8 +534,8 @@ class Core(object):
'ERROR': 'bg_red',
'CRITICAL': 'bg_purple',
}
- elif self.config['log']['console_color'] == "Light":
- cfmt = "%(log_color)s%(asctime)s %(levelname)-8s %(message)s"
+ elif self.config['log']['color_theme'] == "light":
+ cfmt = "%(log_color)s%(asctime)s %(levelname)-8s %(message)s"
clr = {
'DEBUG': 'cyan',
'WARNING': 'yellow',
@@ -545,7 +543,9 @@ class Core(object):
'CRITICAL': 'purple',
}
console_frm = ColoredFormatter(cfmt, datefmt, clr)
-
+ else:
+ console_frm = fh_frm
+
#: set console formatter
console.setFormatter(console_frm)
diff --git a/pyload/config/default.py b/pyload/config/default.py
index 8e2dcae74..5a879547a 100644
--- a/pyload/config/default.py
+++ b/pyload/config/default.py
@@ -25,7 +25,8 @@ def make_config(config):
("file_log", "bool", _("File Log"), True),
("log_count", "int", _("Count"), 5),
("log_rotate", "bool", _("Log Rotate"), True),
- ("console_color", "No;Light;Full", _("Colorize Console"), "Light"),
+ ("console_color", "bool", _("Colorize Console"), True),
+ ("color_theme", "light;full", _("Color Theme"), "light"),
])
config.addConfigSection("permission", _("Permissions"), _("Description"), _("Long description"),