summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-09-22 20:34:53 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-09-22 20:34:53 (GMT)
commit0258ce8f0a992ffe24a7b77314603cc7224c3971 (patch)
tree314e52428a4824522aa8532ca1e48faee5591531 /Doc
parentb5d23b4dfc8a4edef01971c9985a4300b28f536b (diff)
downloadcpython-0258ce8f0a992ffe24a7b77314603cc7224c3971.zip
cpython-0258ce8f0a992ffe24a7b77314603cc7224c3971.tar.gz
cpython-0258ce8f0a992ffe24a7b77314603cc7224c3971.tar.bz2
logging: Added QueueHandler.prepare and updated documentation.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/logging.rst16
1 files changed, 15 insertions, 1 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 6cfd93f..04a1e5b 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -944,6 +944,7 @@ Loggers have the following attributes and methods. Note that Loggers are never
instantiated directly, but always through the module-level function
``logging.getLogger(name)``.
+.. class:: Logger
.. attribute:: Logger.propagate
@@ -2661,7 +2662,20 @@ supports sending logging messages to a queue, such as those implemented in the
.. method:: emit(record)
- Sends the record to the handler's queue.
+ Enqueues the result of preparing the LogRecord.
+
+ .. method:: prepare(record)
+
+ Prepares a record for queuing. The object returned by this
+ method is enqueued.
+
+ The base implementation formats the record to merge the message
+ and arguments, and removes unpickleable items from the record
+ in-place.
+
+ You might want to override this method if you want to convert
+ the record to a dict or JSON string, or send a modified copy
+ of the record while leaving the original intact.
.. method:: enqueue(record)