summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-03-13 20:48:10 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-03-13 20:48:10 (GMT)
commit7fd6068c3e341f4e34bab2102ab2a056484d7c03 (patch)
tree3a6bfed3c18bd8b7f941474211bed5c9280dd228 /Lib/logging
parent95f9c4cfb3bc4e5233b3655de13faa2d4eec95e1 (diff)
downloadcpython-7fd6068c3e341f4e34bab2102ab2a056484d7c03.zip
cpython-7fd6068c3e341f4e34bab2102ab2a056484d7c03.tar.gz
cpython-7fd6068c3e341f4e34bab2102ab2a056484d7c03.tar.bz2
Merged revisions 68737 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68737 | jesse.noller | 2009-01-18 15:04:36 -0600 (Sun, 18 Jan 2009) | 1 line issue 4301: patch logging to add processName, remove the old _check_logger_class code ........
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 90fe581..8c2a38c 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -97,6 +97,11 @@ raiseExceptions = 1
logThreads = 1
#
+# If you don't want multiprocessing information in the log, set this to zero
+#
+logMultiprocessing = 1
+
+#
# If you don't want process information in the log, set this to zero
#
logProcesses = 1
@@ -263,6 +268,11 @@ class LogRecord:
else:
self.thread = None
self.threadName = None
+ if logMultiprocessing:
+ from multiprocessing import current_process
+ self.processName = current_process().name
+ else:
+ self.processName = None
if logProcesses and hasattr(os, 'getpid'):
self.process = os.getpid()
else: