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")
docstr: Emit a log message on my socket.
docstr_tok: ["Emit","a","log","message","on","my","socket","."]
code: def emit(self, record):
      """Emit a log message on my socket."""
  
      # LogRecord.getMessage explicitly allows msg to be anything _castable_ to a str
      try:
          topic, msg = str(record.msg).split(TOPIC_DELIM, 1)
      except ValueError:
          topic = ""
      else:
          # copy to avoid mutating LogRecord in-place
          record = copy(record)
          record.msg = msg
  
      try:
          bmsg = self.format(record).encode("utf8")
      except Exception:
          self.handleError(record)
          return
  
      topic_list = []
  
      if self.root_topic:
          topic_list.append(self.root_topic)
  
      topic_list.append(record.levelname)
  
      if topic:
          topic_list.append(topic)
  
      btopic = ".".join(topic_list).encode("utf8", "replace")
  
      self.socket.send_multipart([btopic, bmsg])
  
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 7 for calling the PUBHandler obj's underlying member method code with example usage: obj.emit(record) without return types