ILogRegistry

public interface ILogRegistry
implements Log.ILogOutput

com.android.tradefed.log.ILogRegistry


An interface for a Log.ILogOutput singleton logger that multiplexes and manages different loggers.

Summary

Nested classes

enum ILogRegistry.EventType

Events that are useful to be logged  

Public methods

abstract void closeAndRemoveAllLogs()

Closes and removes all logs being managed by this LogRegistry.

abstract void dumpLogs()

Diagnosis method to dump all logs to files.

abstract void dumpToGlobalLog(ILeveledLogOutput log)

Dumps the entire contents of a ILeveledLogOutput logger to the global log.

abstract Log.LogLevel getGlobalLogDisplayLevel()

Returns current log level display for the global log

abstract void logEvent(Log.LogLevel logLevel, ILogRegistry.EventType event, Map<String, String> args)

Call this method to log an event from a type with the associated information in the map.

abstract void registerLogger(ILeveledLogOutput log)

Registers the logger as the instance to use for the current thread.

abstract void saveGlobalLog()

Saves all the global loggers contents to tmp files.

abstract void setGlobalLogDisplayLevel(Log.LogLevel logLevel)

Set the log level display for the global log

abstract void unregisterLogger()

Unregisters the current logger in effect for the current thread.

Public methods

closeAndRemoveAllLogs

public abstract void closeAndRemoveAllLogs ()

Closes and removes all logs being managed by this LogRegistry.

dumpLogs

public abstract void dumpLogs ()

Diagnosis method to dump all logs to files.

dumpToGlobalLog

public abstract void dumpToGlobalLog (ILeveledLogOutput log)

Dumps the entire contents of a ILeveledLogOutput logger to the global log.

This is useful in scenarios where you know the logger's output won't be saved permanently, yet you want the contents to be saved somewhere and not lost.

getGlobalLogDisplayLevel

public abstract Log.LogLevel getGlobalLogDisplayLevel ()

Returns current log level display for the global log

Returns
Log.LogLevel logLevel the Log.LogLevel to use

logEvent

public abstract void logEvent (Log.LogLevel logLevel, 
                ILogRegistry.EventType event, 
                Map<String, String> args)

Call this method to log an event from a type with the associated information in the map. Time of the event is automatically added.

Parameters
logLevel Log.LogLevel: the Log.LogLevel to be printed.

event ILogRegistry.EventType: the ILogRegistry.EventType of the event to log.

args Map: the map of arguments to be added to the log entry to get more details on the event.

registerLogger

public abstract void registerLogger (ILeveledLogOutput log)

Registers the logger as the instance to use for the current thread.

Parameters
log ILeveledLogOutput

saveGlobalLog

public abstract void saveGlobalLog ()

Saves all the global loggers contents to tmp files.

setGlobalLogDisplayLevel

public abstract void setGlobalLogDisplayLevel (Log.LogLevel logLevel)

Set the log level display for the global log

Parameters
logLevel Log.LogLevel: the Log.LogLevel to use

unregisterLogger

public abstract void unregisterLogger ()

Unregisters the current logger in effect for the current thread.