summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Logger.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-19 15:05:51 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-19 15:05:51 -0400
commit71d7285c405bd639f1f9f2642ea8fb567b97caec (patch)
treed211f7aa4f45ae513ebab3923e14d9b2eb4965a3 /src/lib/Bcfg2/Logger.py
parent182f95cc48029617825dabede3fc812c36995146 (diff)
downloadbcfg2-71d7285c405bd639f1f9f2642ea8fb567b97caec.tar.gz
bcfg2-71d7285c405bd639f1f9f2642ea8fb567b97caec.tar.bz2
bcfg2-71d7285c405bd639f1f9f2642ea8fb567b97caec.zip
Debug improvements:
* Added (set|toggle)_core_debug RMI methods to set debugging in the core * Enable plugin debugging when run with -d * Allow enabling debugging on Reporting plugin before threads have started
Diffstat (limited to 'src/lib/Bcfg2/Logger.py')
-rw-r--r--src/lib/Bcfg2/Logger.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Logger.py b/src/lib/Bcfg2/Logger.py
index c2eac1e60..618d0f2cd 100644
--- a/src/lib/Bcfg2/Logger.py
+++ b/src/lib/Bcfg2/Logger.py
@@ -139,6 +139,7 @@ def add_console_handler(level=logging.DEBUG):
console.setLevel(level)
# tell the handler to use this format
console.setFormatter(TermiosFormatter())
+ console.set_name("console")
logging.root.addHandler(console)
@@ -153,6 +154,7 @@ def add_syslog_handler(procname, syslog_facility, level=logging.DEBUG):
syslog = FragmentingSysLogHandler(procname,
('localhost', 514),
syslog_facility)
+ syslog.set_name("syslog")
syslog.setLevel(level)
syslog.setFormatter(
logging.Formatter('%(name)s[%(process)d]: %(message)s'))
@@ -166,6 +168,7 @@ def add_syslog_handler(procname, syslog_facility, level=logging.DEBUG):
def add_file_handler(to_file, level=logging.DEBUG):
"""Add a logging handler that logs to to_file."""
filelog = logging.FileHandler(to_file)
+ filelog.set_name("file")
filelog.setLevel(level)
filelog.setFormatter(
logging.Formatter('%(asctime)s %(name)s[%(process)d]: %(message)s'))