Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8552d1f commit 0055c42Copy full SHA for 0055c42
1 file changed
Doc/library/logging.rst
@@ -2647,14 +2647,17 @@ socket is created separately and passed to the handler (as its 'queue')::
2647
data = json.dumps(record.__dict__)
2648
self.queue.send(data)
2649
2650
+ handler = ZeroMQSocketHandler(sock)
2651
+
2652
2653
Of course there are other ways of organizing this, for example passing in the
2654
data needed by the handler to create the socket::
2655
2656
class ZeroMQSocketHandler(QueueHandler):
2657
def __init__(self, uri, socktype=zmq.PUB, ctx=None):
2658
self.ctx = ctx or zmq.Context()
2659
socket = zmq.Socket(self.ctx, socktype)
- super(ZeroMQSocketHandler, self).__init__(socket)
2660
+ QueueHandler.__init__(self, socket)
2661
2662
def enqueue(self, record):
2663
0 commit comments