move the loghandler function to snifferutil.h