title: How to check if a logger exists
body: <p>I've had to extend the existing logging library to add some features. One of these is a feature which lets a handler listen to any existing log without knowing if it exists beforehand. The following allows the handler to listen, but does not check if the log exists:</p>
  
  <pre><code>def listen_to_log(target, handler):
      logging.getLogger(target).addHandler(handler)
  </code></pre>
  
  <p>The issue is that I don't want any handler to listen to a log which isn't being logged to, and want to raise a <code>ValueError</code> if the log doesn't already exist. Ideally I'd do something like the following:</p>
  
  <pre><code>def listen_to_log(target, handler):
      if not logging.logExists(target):
          raise ValueError('Log not found')
      logging.getLogger(target).addHandler(handler)
  </code></pre>
  
  <p>So far I have been unable to find a function like <code>logging.logExists</code>, is there such a function, or a convenient workaround?</p>