Make it possible to capture logs of test runs

When tests are failing, it is often useful to capture Puppet's logs of the
test run. This change makes it possible to send the log to a file, and to
adjust Puppet's log level.

Thanks to Josh Cooper for pointing out how to do this