'Set the current logging context in thread local storage
Args:
context(LoggingContext): The context to activate.
Returns:
The context that was previously active'

@classmethod
def set_current_context(cls, context):

    current = cls.current_context()
    if (current is not context):
        current.stop()
        cls.thread_local.current_context = context
        context.start()
    return current
