'Restores the current logging context'

def __exit__(self, type, value, traceback):

    context = LoggingContext.set_current_context(self.current_context)
    if (context != self.new_context):
        logger.debug('Unexpected    logging    context:    %s    is    not    %s', context, self.new_context)
    if (self.current_context is not LoggingContext.sentinel):
        if (not self.current_context.alive):
            logger.debug('Restoring    dead    context:    %s', self.current_context)
