class_docstr: A simple class that receives messages on a SUB socket, as published
  by subclasses of `zmq.log.handlers.PUBHandler`, and logs them itself.
  
  This can subscribe to multiple topics, but defaults to all topics.
class_docstr_tok: ["A","simple","class","that","receives","messages","on","a","SUB","socket",",","as","published","by","subclasses","of","`","zmq.log.handlers.PUBHandler","`",",","and","logs","them","itself",".","This","can","subscribe","to","multiple","topics",",","but","defaults","to","all","topics","."]
docstr: Turn 'engine.0.INFO.extra' into (logging.INFO, 'engine.0.extra')
docstr_tok: ["Turn","'engine.0.INFO.extra","'","into","(","logging.INFO",",","'engine.0.extra","'",")"]
code: def _extract_level(self, topic_str):
      """Turn 'engine.0.INFO.extra' into (logging.INFO, 'engine.0.extra')"""
      topics = topic_str.split(".")
      for idx, t in enumerate(topics):
          level = getattr(logging, t, None)
          if level is not None:
              break
  
      if level is None:
          level = logging.INFO
      else:
          topics.pop(idx)
  
      return level, ".".join(topics)
  
file_path: ipyparallel/ipyparallel/apps/logwatcher.py
imports: import logging
  import zmq
  from jupyter_client.localinterfaces import localhost
  from tornado import ioloop
  from traitlets import Instance, List, Unicode
  from traitlets.config.configurable import LoggingConfigurable
  from zmq.eventloop import zmqstream
label_desc: Use image node_id 8 for calling the LogWatcher obj's underlying member method code with example usage: obj._extract_level(topic_str) and returns: level,  str