Contextual Logger for Python
>>> logging.basicConfig(level=logging.INFO)
>>> logger = logging.getLogger()
>>> cxtlgr = cxtlog.wrap(logger)
>>> with cxtlgr.cxt('test'):
... print('Hello')
...
INFO:root:Start: test
Hello
INFO:root:Complete: test
>>> with cxtlgr.cxt('error'):
... 1 / 0
...
INFO:root:Start: error
ERROR:root:Fail: error
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero