title: Summary count for Python logging
body: <p>At the end of my Python program, I'd like to be able to get a summary of the number of items logged through the standard <a href="http://docs.python.org/library/logging.html" rel="nofollow noreferrer"><code>logging</code></a> module. I'd specifically like to be able to get a count for each specified name (and possibly its children). E.g. if I have:</p>
  
  <pre><code>input_logger = getLogger('input')
  input_logger.debug("got input1")
  input_logger.debug("got input2")
  input_logger.debug("got input3")
  
  network_input_logger = getLogger('input.network')
  network_input_logger.debug("got network input1")
  network_input_logger.debug("got network input2")
  
  getLogger('output')
  output_logger.debug("sent output1")
  </code></pre>
  
  <p>Then at the end I'd like to get a summary such as:</p>
  
  <pre><code>input: 5
  input.network: 2
  output: 1
  </code></pre>
  
  <p>I'm thinking, by calling a <code>getcount()</code> method for a logger or a handler.</p>
  
  <p>What would be a good way to achieve this? I imagine it would involve a sub-class of one of the classes in the <code>logging</code> module, but I'm not sure what would be the best way to go.</p>