Fix logging for tests