oslotest.log module¶
- class oslotest.log.ConfigureLogging(format='%(levelname)8s [%(name)s] %(message)s')¶
Bases:
Fixture
Configure logging.
The behavior is managed through two environment variables. If
OS_DEBUG
is true then the logging level is set to debug. IfOS_LOG_CAPTURE
is true a FakeLogger is configured. Alternatively,OS_DEBUG
can be set to an explicit log level, such asINFO
.“True” values include
True
,true
,1
andyes
. Valid log levels includeDEBUG
,INFO
,WARNING
,ERROR
,TRACE
andCRITICAL
(or any other valid integer logging level).- logger¶
The logger fixture, if it is created.
- level¶
logging.DEBUG
if debug logging is enabled, otherwise the log level specified byOS_DEBUG
, otherwiseNone
.
- Parameters:
format – The logging format string to use.
- DEFAULT_FORMAT = '%(levelname)8s [%(name)s] %(message)s'¶
Default log format
- setUp()¶
Prepare the Fixture for use.
This should not be overridden. Concrete fixtures should implement _setUp. Overriding of setUp is still supported, just not recommended.
After setUp has completed, the fixture will have one or more attributes which can be used (these depend totally on the concrete subclass).
- Raises:
MultipleExceptions if _setUp fails. The last exception captured within the MultipleExceptions will be a SetupError exception.
- Returns:
None.
- Changed in 1.3:
The recommendation to override setUp has been reversed - before 1.3, setUp() should be overridden, now it should not be.
- Changed in 1.3.1:
BaseException is now caught, and only subclasses of Exception are wrapped in MultipleExceptions.