diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-14 09:42:39 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-14 09:42:39 (GMT) |
commit | 0055c421fed0d2b8e8760ba69fd7138ca77475c2 (patch) | |
tree | 83ce8f16100aed2404d131cf6134cb1f763a366a /Doc | |
parent | 8552d1fc8fd37fa03f5ab269f59ce4029afa04dd (diff) | |
download | cpython-0055c421fed0d2b8e8760ba69fd7138ca77475c2.zip cpython-0055c421fed0d2b8e8760ba69fd7138ca77475c2.tar.gz cpython-0055c421fed0d2b8e8760ba69fd7138ca77475c2.tar.bz2 |
Tidied example script.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/logging.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index fa230a0..a05b99f 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -2647,6 +2647,9 @@ socket is created separately and passed to the handler (as its 'queue'):: 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 @@ data needed by the handler to create the socket:: 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__) |