Use contextdecorator from contextlib2. add logging for entering context.