fix bugs in compare trace and LogWriter