In some cases, having access to only the test results isn't enough; having the log files is necessary to complete the overall results.
Log interface
Any result reporter or test event
can have access to the logs by implementing
ILogSaverListener
,
which lets a reporter receive the logs through different callbacks:
testLogSaved
: Called right away when a file is logged. This notifies a new file has been logged. This is called at any time.logAssociation
: Called in order with the test events. This ensures a strong association between the file being logged and the events in progress.
By implementing this interface, the result reporter can have access to the logged file references and use them.
When to use logAssociation
logAssociation
is a slightly more complicated event as it relies on the
context of the events to be properly interpreted. For example, if the
testStart
has been called, the log from logAssociation
belongs to the test
case in progress.
This strong association allows for correct placement of logs.