title: Create logger that prefixes log messages
body: <p>Let's say I have a client and server class:</p>
  
  <pre><code>import logging
  
  class Client:
      def __init__(self, name):
          self.logger = logging.getLogger(self.__class__.__name__)
          self.name = name
  
      def foo(self):
          self.logger.warn('[%s] foo', self.name)
  
  class Server:
      def __init__(self):
          self.logger = logging.getLogger(self.__class__.__name__)
  
      def bar(self):
          self.logger.warn('bar')
  </code></pre>
  
  <p>How could I make a logger for the client that will take care of the <code>[self.name]</code> prefix magically? The only Idea I have would be to set a global format including <code>%(client)</code>-prefix and using a custom filter for the <code>Client</code>. This seems unecessary complicated and global. I feel like there must be a simple way that I just don't see.</p>