parameters: (logging_level=None, logger=None, stream=None,
                        handlers=None)
return_statement: return handlers
docstring: Configure logging for standard purposes.
  
      Returns:
        A list of references to the logging handlers added to the root
        logger.  This allows the caller to later remove the handlers
        using logger.removeHandler.  This is useful primarily during unit
        testing where the caller may want to configure logging temporarily
        and then undo the configuring.
  
      Args:
        logging_level: The minimum logging level to log.  Defaults to
                       logging.INFO.
        logger: A logging.logger instance to configure.  This parameter
                should be used only in unit tests.  Defaults to the
                root logger.
        stream: A file-like object to which to log used in creating the default
                handlers.  The stream must define an "encoding" data attribute,
                or else logging raises an error.  Defaults to sys.stderr.
        handlers: A list of logging.Handler instances to add to the logger
                  being configured.  If this parameter is provided, then the
                  stream parameter is not used.
docstring_summary: Configure logging for standard purposes.
docstring_tokens: Configure logging for standard purposes .
function: def configure_logging(logging_level=None, logger=None, stream=None,
                        handlers=None):
      """Configure logging for standard purposes.
  
      Returns:
        A list of references to the logging handlers added to the root
        logger.  This allows the caller to later remove the handlers
        using logger.removeHandler.  This is useful primarily during unit
        testing where the caller may want to configure logging temporarily
        and then undo the configuring.
  
      Args:
        logging_level: The minimum logging level to log.  Defaults to
                       logging.INFO.
        logger: A logging.logger instance to configure.  This parameter
                should be used only in unit tests.  Defaults to the
                root logger.
        stream: A file-like object to which to log used in creating the default
                handlers.  The stream must define an "encoding" data attribute,
                or else logging raises an error.  Defaults to sys.stderr.
        handlers: A list of logging.Handler instances to add to the logger
                  being configured.  If this parameter is provided, then the
                  stream parameter is not used.
  
      """
      # If the stream does not define an "encoding" data attribute, the
      # logging module can throw an error like the following:
      #
      # Traceback (most recent call last):
      #   File "/System/Library/Frameworks/Python.framework/Versions/2.6/...
      #         lib/python2.6/logging/__init__.py", line 761, in emit
      #     self.stream.write(fs % msg.encode(self.stream.encoding))
      # LookupError: unknown encoding: unknown
      if logging_level is None:
          logging_level = logging.INFO
      if logger is None:
          logger = logging.getLogger()
      if stream is None:
          stream = sys.stderr
      if handlers is None:
          handlers = _default_handlers(stream, logging_level)
  
      logger.setLevel(logging_level)
  
      for handler in handlers:
          logger.addHandler(handler)
  
      _log.debug("Debug logging enabled.")
  
      return handlers
function_tokens: def configure_logging ( logging_level = None , logger = None , stream = None , handlers = None ) : # If the stream does not define an "encoding" data attribute, the # logging module can throw an error like the following: # # Traceback (most recent call last): #   File "/System/Library/Frameworks/Python.framework/Versions/2.6/... #         lib/python2.6/logging/__init__.py", line 761, in emit #     self.stream.write(fs % msg.encode(self.stream.encoding)) # LookupError: unknown encoding: unknown if logging_level is None : logging_level = logging . INFO if logger is None : logger = logging . getLogger ( ) if stream is None : stream = sys . stderr if handlers is None : handlers = _default_handlers ( stream , logging_level ) logger . setLevel ( logging_level ) for handler in handlers : logger . addHandler ( handler ) _log . debug ( "Debug logging enabled." ) return handlers