parameters: (logger, logging_config, build_id=None, build_config=None)
docstring: Adds a buildlogger.BuildloggerGlobalHandler to 'logger' if specified
      to do so by the configuration.
docstring_summary: Adds a buildlogger.BuildloggerGlobalHandler to 'logger' if specified
      to do so by the configuration.
docstring_tokens: Adds a buildlogger . BuildloggerGlobalHandler to logger if specified to do so by the configuration .
function: def apply_buildlogger_global_handler(logger, logging_config, build_id=None, build_config=None):
      """
      Adds a buildlogger.BuildloggerGlobalHandler to 'logger' if specified
      to do so by the configuration.
      """
  
      logger_info = logging_config[loggers.FIXTURE_LOGGER_NAME]
      handler_info = _get_buildlogger_handler_info(logger_info)
      if handler_info is None:
          # Not configured to use buildlogger.
          return
  
      if all(x is not None for x in (build_id, build_config)):
          log_format = logger_info.get("format", _DEFAULT_FORMAT)
          formatter = formatters.ISO8601Formatter(fmt=log_format)
  
          handler = buildlogger.BuildloggerGlobalHandler(build_id,
                                                         build_config,
                                                         **handler_info)
          handler.setFormatter(formatter)
      else:
          handler = _fallback_buildlogger_handler()
          # Fallback handler already has formatting configured.
  
      logger.addHandler(handler)
function_tokens: def apply_buildlogger_global_handler ( logger , logging_config , build_id = None , build_config = None ) : logger_info = logging_config [ loggers . FIXTURE_LOGGER_NAME ] handler_info = _get_buildlogger_handler_info ( logger_info ) if handler_info is None : # Not configured to use buildlogger. return if all ( x is not None for x in ( build_id , build_config ) ) : log_format = logger_info . get ( "format" , _DEFAULT_FORMAT ) formatter = formatters . ISO8601Formatter ( fmt = log_format ) handler = buildlogger . BuildloggerGlobalHandler ( build_id , build_config , * * handler_info ) handler . setFormatter ( formatter ) else : handler = _fallback_buildlogger_handler ( ) # Fallback handler already has formatting configured. logger . addHandler ( handler )