Capture log output during unit tests