'Restore the logging context in thread local storage to the state it
was before this context was entered.
Returns:
None to avoid suppressing any exeptions that were thrown.'

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

    current = self.set_current_context(self.previous_context)
    if (current is not self):
        if (current is self.sentinel):
            logger.debug('Expected    logging    context    %s    has    been    lost', self)
        else:
            logger.warn('Current    logging    context    %s    is    not    expected    context    %s', current, self)
    self.previous_context = None
    self.alive = False
