code: def before_sleep_log(logger, log_level, exc_info=False):
      """Before call strategy that logs to some logger the attempt."""
  
      def log_it(retry_state):
          if retry_state.outcome.failed:
              ex = retry_state.outcome.exception()
              verb, value = "raised", "%s: %s" % (type(ex).__name__, ex)
  
              if exc_info:
                  local_exc_info = get_exc_info_from_future(
                      retry_state.outcome
                  )
              else:
                  local_exc_info = False
          else:
              verb, value = "returned", retry_state.outcome.result()
              local_exc_info = (
                  False  # exc_info does not apply when no exception
              )
  
          logger.log(
              log_level,
              "Retrying %s in %s seconds as it %s %s.",
              _utils.get_callback_name(retry_state.fn),
              getattr(retry_state.next_action, "sleep"),
              verb,
              value,
              exc_info=local_exc_info,
          )
  
      return log_it
  
label_desc: Use image node_id 2 for calling a global function with example usage: before_sleep_log(logger, log_level, exc_info) and returns: log_it