def fileConfig(fname, defaults=None, disable_existing_loggers=1):
 import ConfigParser
 cp = ConfigParser.ConfigParser(defaults)
 if (hasattr(cp, 'readfp') and hasattr(fname, 'readline')):
  cp.readfp(fname)
 else:
  cp.read(fname)
 formatters = _create_formatters(cp)
 logging._acquireLock()
 try:
  logging._handlers.clear()
  del logging._handlerList[:]
  handlers = _install_handlers(cp, formatters)
  _install_loggers(cp, handlers, disable_existing_loggers)
 finally:
  logging._releaseLock()

def fileConfig ( fname , defaults = None , disable_existing_loggers = 1 ) : import ConfigParser cp = ConfigParser . ConfigParser ( defaults ) if ( hasattr ( cp , 'readfp' ) and hasattr ( fname , 'readline' ) ) : cp . readfp ( fname ) else : cp . read ( fname ) formatters = _create_formatters ( cp ) logging . _acquireLock ( ) try : logging . _handlers . clear ( ) del logging . _handlerList [ : ] handlers = _install_handlers ( cp , formatters ) _install_loggers ( cp , handlers , disable_existing_loggers ) finally : logging . _releaseLock ( )
read the logging configuration from a configparser-format file .