| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/zmq/log/__pycache__/ |
Upload File : |
o
;j< � @ s� d Z ddlmZ ddlZddlmZ ddlZdZG dd� dej�ZG dd � d ej �Z
d
�� D ]Zze
ej e�ZW n eyA Y q.w ee
edd� � q.dS )
a� pyzmq logging handlers.
This mainly defines the PUBHandler object for publishing logging messages over
a zmq.PUB socket.
The PUBHandler can be used with the regular logging module, as in::
>>> import logging
>>> handler = PUBHandler('tcp://127.0.0.1:12345')
>>> handler.root_topic = 'foo'
>>> logger = logging.getLogger('foobar')
>>> logger.setLevel(logging.DEBUG)
>>> logger.addHandler(handler)
Or using ``dictConfig``, as in::
>>> from logging.config import dictConfig
>>> socket = Context.instance().socket(PUB)
>>> socket.connect('tcp://127.0.0.1:12345')
>>> dictConfig({
>>> 'version': 1,
>>> 'handlers': {
>>> 'zmq': {
>>> 'class': 'zmq.log.handlers.PUBHandler',
>>> 'level': logging.DEBUG,
>>> 'root_topic': 'foo',
>>> 'interface_or_socket': socket
>>> }
>>> },
>>> 'root': {
>>> 'level': 'DEBUG',
>>> 'handlers': ['zmq'],
>>> }
>>> })
After this point, all messages logged by ``logger`` will be published on the
PUB socket.
Code adapted from StarCluster:
https://github.com/jtriley/StarCluster/blob/StarCluster-0.91/starcluster/logger.py
� )�annotationsN)�copyz::c @ sx e Zd ZU dZded<