added log interface
fixed bad fd check and parameter in etrace_init