refactor test logging