ILogRegistry

public interface ILogRegistry
implements Log.ILogOutput

com.android.tradefed.log.ILogRegistry
Known Indirect Subclasses
LogRegistry A ILogRegistry implementation that multiplexes and manages different loggers, using the appropriate one based on the ThreadGroup of the thread making the call. 


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 setGlobalLogTagDisplay(Collection<String> logTagsDisplay)

Set the log tags to display for the global log

abstract void unregisterLogger()

Unregisters the current logger in effect for the current thread.

Public methods

closeAndRemoveAllLogs

void closeAndRemoveAllLogs ()

Closes and removes all logs being managed by this LogRegistry.

dumpLogs

void dumpLogs ()

Diagnosis method to dump all logs to files.

dumpToGlobalLog

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

Log.LogLevel getGlobalLogDisplayLevel ()

Returns current log level display for the global log

Returns
Log.LogLevel logLevel the Log.LogLevel to use

logEvent

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

void registerLogger (ILeveledLogOutput log)

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

Parameters
log ILeveledLogOutput

saveGlobalLog

void saveGlobalLog ()

Saves all the global loggers contents to tmp files.

setGlobalLogDisplayLevel

void setGlobalLogDisplayLevel (Log.LogLevel logLevel)

Set the log level display for the global log

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

setGlobalLogTagDisplay

void setGlobalLogTagDisplay (Collection<String> logTagsDisplay)

Set the log tags to display for the global log

Parameters
logTagsDisplay Collection

unregisterLogger

void unregisterLogger ()

Unregisters the current logger in effect for the current thread.