Configured logger.

def configured_logger(name=None, config=None, level=None, handlers=None):
    '''Configured logger.
    '''
    name = name or ''
    with process_global('lock'):
        logconfig = process_global('_config_logging')
        # if the logger was not configured, do so.
        if not logconfig:
            logconfig = deepcopy(config or LOGGING_CONFIG)
            logconfig['configured'] = set()
            process_global('_config_logging', logconfig, True)
        else:
            configured = logconfig.get('configured')
            if name in configured:
                return logging.getLogger(name)

        level = get_level(level)
        # No loggers configured. This means no logconfig setting
        # parameter was used. Set up the root logger with default
        # loggers
        if level == logging.NOTSET:
            handlers = ['silent']

        level = logging.getLevelName(level)
        cfg = {'level': level, 'propagate': False}
        if handlers:
            cfg['handlers'] = handlers

        config = copy(logconfig)
        configured = config.pop('configured')
        configured.add(name)

        if name:
            config.pop('root', None)
            loggers = config.pop('logger', {})
            if name in loggers:
                loggers[name].update(cfg)
                cfg = loggers[name]
            config['loggers'] = {name: cfg}
        else:
            if 'root' in config:
                config['root'].update(cfg)
                cfg = config['root']
            if 'handlers' not in cfg:
                cfg['handlers'] = ['console']
            config['root'] = cfg
        #
        dictConfig(config)
        return logging.getLogger(name)