[Python-checkins] r84797 - python/branches/py3k/Doc/library/logging.rst
vinay.sajip
python-checkins at python.org
Tue Sep 14 11:42:39 CEST 2010
Author: vinay.sajip
Date: Tue Sep 14 11:42:39 2010
New Revision: 84797
Log:
Tidied example script.
Modified:
python/branches/py3k/Doc/library/logging.rst
Modified: python/branches/py3k/Doc/library/logging.rst
==============================================================================
--- python/branches/py3k/Doc/library/logging.rst (original)
+++ python/branches/py3k/Doc/library/logging.rst Tue Sep 14 11:42:39 2010
@@ -2647,6 +2647,9 @@
data = json.dumps(record.__dict__)
self.queue.send(data)
+ handler = ZeroMQSocketHandler(sock)
+
+
Of course there are other ways of organizing this, for example passing in the
data needed by the handler to create the socket::
@@ -2654,7 +2657,7 @@
def __init__(self, uri, socktype=zmq.PUB, ctx=None):
self.ctx = ctx or zmq.Context()
socket = zmq.Socket(self.ctx, socktype)
- super(ZeroMQSocketHandler, self).__init__(socket)
+ QueueHandler.__init__(self, socket)
def enqueue(self, record):
data = json.dumps(record.__dict__)
More information about the Python-checkins
mailing list