allow configuration of email detail

This commit is contained in:
Chronial committed 2014-02-15 09:59:51 +01:00
1 parent 1469243b54
commit fadb71a6f8
1 file changed
+2
+2
View File
@@ -124,6 +124,7 @@ def load_config(file):
config["smtp"]["ssl"] = (config["smtp"]["ssl"].lower() == "true") config["smtp"]["ssl"] = (config["smtp"]["ssl"].lower() == "true")
config["scrub"]["enabled"] = (config["scrub"]["enabled"].lower() == "true") config["scrub"]["enabled"] = (config["scrub"]["enabled"].lower() == "true")
config["email"]["short"] = (config["email"]["short"].lower() == "true")
def setup_logger(): def setup_logger():
@@ -153,6 +154,7 @@ def setup_logger():
email_log = StringIO() email_log = StringIO()
email_logger = logging.StreamHandler(email_log) email_logger = logging.StreamHandler(email_log)
email_logger.setFormatter(log_format) email_logger.setFormatter(log_format)
if config["email"]["short"]:
# Don't send programm stdout in email # Don't send programm stdout in email
email_logger.setLevel(logging.INFO) email_logger.setLevel(logging.INFO)
root_logger.addHandler(email_logger) root_logger.addHandler(email_logger)