hook debugging functions to create a log file
use traceback to log exceptions in log file