Improve logging in tests