'Log handoff requests if handoff logging is enabled and the
handoff was not expected.
We only log handoffs when we\'ve pushed the handoff count further
than we would normally have expected under normal circumstances,
that is (request_node_count - num_primaries), when handoffs goes
higher than that it means one of the primaries must have been
skipped because of error limiting before we consumed all of our
nodes_left.'

def log_handoffs(self, handoffs):

    if (not self.app.log_handoffs):
        return
    extra_handoffs = (handoffs - self.expected_handoffs)
    if (extra_handoffs > 0):
        self.app.logger.increment('handoff_count')
        self.app.logger.warning(('Handoff    requested    (%d)' % handoffs))
        if (extra_handoffs == len(self.primary_nodes)):
            self.app.logger.increment('handoff_all_count')
