summaryrefslogtreecommitdiffstats
path: root/Lib/logging/__init__.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-06-27 21:43:39 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-06-27 21:43:39 (GMT)
commit6f3eaa67e51ed0c1b493a26afdf4417d4105d96d (patch)
tree86c1169f5ae3995f8df6ecf137763f4469d7fcb1 /Lib/logging/__init__.py
parent6ebe61fa807d250ccab419473abd8d746a932e75 (diff)
downloadcpython-6f3eaa67e51ed0c1b493a26afdf4417d4105d96d.zip
cpython-6f3eaa67e51ed0c1b493a26afdf4417d4105d96d.tar.gz
cpython-6f3eaa67e51ed0c1b493a26afdf4417d4105d96d.tar.bz2
SF patch #761519: Fixes for bugs 760703 and 757821
SF bug #760703: SocketHandler and LogRecord don't work well together SF bug #757821: logging module docs Applied Vinay Sajip's patch with a few minor fixups and a NEWS item. Patched __init__.py - added new function makeLogRecord (for bug report 760703). Patched handlers.py - updated some docstrings and deleted some old commented-out code. Patched test_logging.py to make use of makeLogRecord. Patched liblogging.tex to fill documentation gaps (both 760703 and bug 757821).
Diffstat (limited to 'Lib/logging/__init__.py')
-rw-r--r--Lib/logging/__init__.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 9d6aa92..3bd0c6d 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -36,8 +36,8 @@ except ImportError:
__author__ = "Vinay Sajip <vinay_sajip@red-dove.com>"
__status__ = "beta"
-__version__ = "0.4.8"
-__date__ = "22 April 2003"
+__version__ = "0.4.8.1"
+__date__ = "26 June 2003"
#---------------------------------------------------------------------------
# Miscellaneous module data
@@ -233,6 +233,17 @@ class LogRecord:
msg = msg % self.args
return msg
+def makeLogRecord(dict):
+ """
+ Make a LogRecord whose attributes are defined by the specified dictionary,
+ This function is useful for converting a logging event received over
+ a socket connection (which is sent as a dictionary) into a LogRecord
+ instance.
+ """
+ rv = LogRecord(None, None, "", 0, "", (), None)
+ rv.__dict__.update(dict)
+ return rv
+
#---------------------------------------------------------------------------
# Formatter classes and functions
#---------------------------------------------------------------------------