Capture logs to debug tests