(fname, defaults=None, disable_existing_loggers=True)
Read the logging configuration from a ConfigParser-format file.

    This can be called several times from an application, allowing an end user
    the ability to select from various pre-canned configurations (if the
    developer provides a mechanism to present the choices and load the chosen
    configuration).
Read the logging configuration from a ConfigParser-format file.
Read the logging configuration from a ConfigParser - format file .
def fileConfig(fname, defaults=None, disable_existing_loggers=True):
    """
    Read the logging configuration from a ConfigParser-format file.

    This can be called several times from an application, allowing an end user
    the ability to select from various pre-canned configurations (if the
    developer provides a mechanism to present the choices and load the chosen
    configuration).
    """
    import ConfigParser

    cp = ConfigParser.ConfigParser(defaults)
    if hasattr(fname, 'readline'):
        cp.readfp(fname)
    else:
        cp.read(fname)

    formatters = _create_formatters(cp)

    # critical section
    logging._acquireLock()
    try:
        logging._handlers.clear()
        del logging._handlerList[:]
        # Handlers add themselves to logging._handlers
        handlers = _install_handlers(cp, formatters)
        _install_loggers(cp, handlers, disable_existing_loggers)
    finally:
        logging._releaseLock()
def fileConfig ( fname , defaults = None , disable_existing_loggers = True ) : import ConfigParser cp = ConfigParser . ConfigParser ( defaults ) if hasattr ( fname , 'readline' ) : cp . readfp ( fname ) else : cp . read ( fname ) formatters = _create_formatters ( cp ) # critical section logging . _acquireLock ( ) try : logging . _handlers . clear ( ) del logging . _handlerList [ : ] # Handlers add themselves to logging._handlers handlers = _install_handlers ( cp , formatters ) _install_loggers ( cp , handlers , disable_existing_loggers ) finally : logging . _releaseLock ( )