update tmn for python 

support log init and catch exception