BaseStreamLogger

public abstract class BaseStreamLogger
extends BaseLeveledLogOutput

java.lang.Object
   ↳ com.android.tradefed.log.BaseLeveledLogOutput
     ↳ com.android.tradefed.log.BaseStreamLogger<OS extends OutputStream>


A ILeveledLogOutput that directs log messages to an output stream and to stdout.

Summary

Fields

protected OS extends OutputStream mOutputStream

Public constructors

BaseStreamLogger()

Public methods

void closeLog()
Log.LogLevel getLogLevel()
Log.LogLevel getLogLevelDisplay()
void printAndPromptLog(Log.LogLevel logLevel, String tag, String message)
void printLog(Log.LogLevel logLevel, String tag, String message)
void setLogLevel(Log.LogLevel logLevel)
void setLogLevelDisplay(Log.LogLevel logLevel)

For compatibility

void setLogLevelDisplay(Log.LogLevel logLevel)

Sets the minimum LogLevel to display on stdout.

Protected methods

void writeToLog(String message)

Writes a message to the output stream.

Fields

mOutputStream

protected OS extends OutputStream mOutputStream

Public constructors

BaseStreamLogger

public BaseStreamLogger ()

Public methods

closeLog

public void closeLog ()

getLogLevel

public Log.LogLevel getLogLevel ()

Returns
Log.LogLevel

getLogLevelDisplay

public Log.LogLevel getLogLevelDisplay ()

Returns
Log.LogLevel current minimum LogLevel to display on stdout.

printAndPromptLog

public void printAndPromptLog (Log.LogLevel logLevel, 
                String tag, 
                String message)

Parameters
logLevel Log.LogLevel

tag String

message String

printLog

public void printLog (Log.LogLevel logLevel, 
                String tag, 
                String message)

Parameters
logLevel Log.LogLevel

tag String

message String

setLogLevel

public void setLogLevel (Log.LogLevel logLevel)

Parameters
logLevel Log.LogLevel

setLogLevelDisplay

public void setLogLevelDisplay (Log.LogLevel logLevel)

For compatibility

Parameters
logLevel Log.LogLevel

setLogLevelDisplay

public void setLogLevelDisplay (Log.LogLevel logLevel)

Sets the minimum LogLevel to display on stdout.

Parameters
logLevel Log.LogLevel

Protected methods

writeToLog

protected void writeToLog (String message)

Writes a message to the output stream.

Parameters
message String: the entry to write to log

Throws
if an I/O error occurs