Fix log capturing fixture

Instead of nuking the unit test logs capture them according
to how tempest (and oslotest) capture them so that the tests
when ran locally provide the full logging output instead of
a miniaturized version.

This adds in the following environment variables which can
be used to control testr captured logging:

- OS_LOG_CAPTURE (turns on log capturing so that the testr
  repository will have log output, at a INFO level)
- OS_DEBUG (changes the captured logging level from INFO
  to DEBUG, only useful when OS_LOG_CAPTURE is enabled)

It also creates a lambda that is used to test whether an
environment is enabled (avoiding recreating the same set
of checks in multiple places).

Change-Id: I63d9a1b7fc6e7591fd6309cf68d9269117c023a6
Merge "Fix log capturing fixture"