Format traceback in log messages