class_docstr: A basic logging handler that emits log messages through a PUB socket.
  
  Takes a PUB socket already bound to interfaces or an interface to bind to.
  
  Example::
  
      sock = context.socket(zmq.PUB)
      sock.bind('inproc://log')
      handler = PUBHandler(sock)
  
  Or::
  
      handler = PUBHandler('inproc://loc')
  
  These are equivalent.
  
  Log messages handled by this handler are broadcast with ZMQ topics
  ``this.root_topic`` comes first, followed by the log level
  (DEBUG,INFO,etc.), followed by any additional subtopics specified in the
  message by: log.debug("subtopic.subsub::the real message")
code: def __init__(
      self,
      interface_or_socket: Union[str, zmq.Socket],
      context: Optional[zmq.Context] = None,
      root_topic: str = "",
  ) -> None:
      logging.Handler.__init__(self)
      self.root_topic = root_topic
      self.formatters = {
          logging.DEBUG: logging.Formatter(
              "%(levelname)s %(filename)s:%(lineno)d - %(message)s\n"
          ),
          logging.INFO: logging.Formatter("%(message)s\n"),
          logging.WARN: logging.Formatter(
              "%(levelname)s %(filename)s:%(lineno)d - %(message)s\n"
          ),
          logging.ERROR: logging.Formatter(
              "%(levelname)s %(filename)s:%(lineno)d - %(message)s - %(exc_info)s\n"
          ),
          logging.CRITICAL: logging.Formatter(
              "%(levelname)s %(filename)s:%(lineno)d - %(message)s\n"
          ),
      }
      if isinstance(interface_or_socket, zmq.Socket):
          self.socket = interface_or_socket
          self.ctx = self.socket.context
      else:
          self.ctx = context or zmq.Context()
          self.socket = self.ctx.socket(zmq.PUB)
          self.socket.bind(interface_or_socket)
  
file_path: catboost/contrib/python/pyzmq/py3/zmq/log/handlers.py
imports: import logging
  from copy import copy
  from typing import Optional, Union
  import zmq
label_desc: Use image node_id 1 to create a new PUBHandler object from inherited base classes: logging with example: obj = PUBHandler(interface_or_socket, context, root_topic)