This plugin captures logging statements issued during test execution. When an error or failure occurs, the captured log messages are attached to the running test in the test.capturedLogging attribute, and displayed with the error failure output. It is enabled by default but can be turned off with the option --nologcapture.
You can filter captured logging statements with the --logging-filter option. If set, it specifies which logger(s) will be captured; loggers that do not match will be passed. Example: specifying --logging-filter=sqlalchemy,myapp will ensure that only statements logged via sqlalchemy.engine, myapp or myapp.foo.bar logger will be logged.
You can remove other installed logging handlers with the --logging-clear-handlers option.
Disable logging capture plugin. Logging configurtion will be left intact. [NOSE_NOLOGCAPTURE]
Specify custom format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGFORMAT]
Specify custom date/time format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGDATEFMT]
Specify which statements to filter in/out. By default, everything is captured. If the output is too verbose, use this option to filter out needless output. Example: filter=foo will capture statements issued ONLY to foo or foo.what.ever.sub but not foobar or other logger. Specify multiple loggers with comma: filter=foo,bar,baz. If any logger name is prefixed with a minus, eg filter=-foo, it will be excluded rather than included. Default: exclude logging messages from nose itself (-nose). [NOSE_LOGFILTER]
Clear all other logging handlers
Bases: nose.plugins.base.Plugin
Log capture plugin. Enabled by default. Disable with –nologcapture. This plugin captures logging statements issued during test execution, appending any output captured to the error or failure output, should the test fail or raise an error.
Clear buffers after test.
Clear buffers and handlers before test.
Set up logging handler before test run begins.
Configure plugin.
Add captured log messages to error output.
Add captured log messages to failure output.
Register commandline options.