ILogSaverListener

public interface ILogSaverListener
implements ITestInvocationListener

com.android.tradefed.result.ILogSaverListener
Known Indirect Subclasses
ConsoleResultReporter Result reporter to print the test results to the console. 
FileMetadataCollector A listener that collects and uploads metadata about saved log files. 
TextResultReporter A test result reporter that forwards results to the JUnit text result printer. 
XmlResultReporter Writes JUnit results to an XML files in a format consistent with Ant's XMLJUnitResultFormatter. 


Allows for ITestInvocationListeners to listen for when log files are saved.

This allows for multiple ITestInvocationListeners to use the same saved log file when generating reports, and avoids having each listener save the file individually when testLog(String, LogDataType, InputStreamSource) is called.

Classes implementing this interface should be aware that testLogSaved(String, LogDataType, InputStreamSource, LogFile) will be called whenever testLog(String, LogDataType, InputStreamSource) is called.

This class also passes the global ILogSaver instance so ITestInvocationListeners can save additional files in the same location.

Summary

Public methods

abstract void setLogSaver(ILogSaver logSaver)

Set the ILogSaver to allow the implementor to save files.

abstract void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)

Called when the test log is saved.

Public methods

setLogSaver

void setLogSaver (ILogSaver logSaver)

Set the ILogSaver to allow the implementor to save files.

Parameters
logSaver ILogSaver: the ILogSaver

testLogSaved

void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

Called when the test log is saved.

Should be used in place of testLog(String, LogDataType, InputStreamSource).

Parameters
dataName String: a String descriptive name of the data. e.g. "device_logcat". Note dataName may not be unique per invocation. ie implementers must be able to handle multiple calls with same dataName
dataType LogDataType: the LogDataType of the data
dataStream InputStreamSource: the InputStreamSource of the data. Implementers should call createInputStream to start reading the data, and ensure to close the resulting InputStream when complete.
logFile LogFile: the LogFile containing the meta data of the saved file.