def foo(): logstack.push(in_foo=True) bar() logstack.push(out_of_bar=True) baz()
def bar(): logstack.push(in_bar=True)
def baz(): logstack.push(in_baz=True) with logstack.pushed(something=[1, 2, 3]): logging.warning("warning here") raise ValueError("ohno")
def foo(): logstack.push(in_foo=True) bar() logstack.push("out of bar") baz()