summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2006-03-13 22:05:28 +0000
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2006-03-13 22:05:28 +0000
commitd364a07517bb2a413e5d4739c2f43c4af218be43 (patch)
tree2879a5fe2ed991916c4a020d4a6bd4911879d2ac
parent6da8cebe3ccf3a35a138ec6aeb03250bc86f9527 (diff)
downloadcpython-git-d364a07517bb2a413e5d4739c2f43c4af218be43.tar.gz
Added logThreads and logProcesses to allow conditional omission of logging this information
-rw-r--r--Lib/logging/__init__.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 853b606ebb..d82d6671b3 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -89,6 +89,16 @@ _startTime = time.time()
#
raiseExceptions = 1
+#
+# If you don't want threading information in the log, set this to zero
+#
+logThreads = 1
+
+#
+# If you don't want process information in the log, set this to zero
+#
+logProcesses = 1
+
#---------------------------------------------------------------------------
# Level related stuff
#---------------------------------------------------------------------------
@@ -243,13 +253,13 @@ class LogRecord:
self.created = ct
self.msecs = (ct - long(ct)) * 1000
self.relativeCreated = (self.created - _startTime) * 1000
- if thread:
+ if logThreads and thread:
self.thread = thread.get_ident()
self.threadName = threading.currentThread().getName()
else:
self.thread = None
self.threadName = None
- if hasattr(os, 'getpid'):
+ if logProcesses and hasattr(os, 'getpid'):
self.process = os.getpid()
else:
self.process = None