Object StreamLog
-
- All Implemented Interfaces:
public class StreamLogAPI for sending log output.
Generally, you should use the StreamLog.v, StreamLog.d, StreamLog.i, StreamLog.w, and StreamLog.e methods to write logs.
The order in terms of verbosity, from least to most is ERROR, WARN, INFO, DEBUG, VERBOSE.
-
-
Field Summary
Fields Modifier and Type Field Description private final static BooleanisInstalledpublic final static StreamLogINSTANCE
-
Method Summary
Modifier and Type Method Description final static Unitinstall(StreamLogger logger)Installs a new StreamLogger implementation to be used. final static UnitunInstall()Uninstall a previous StreamLogger implementation. final static UnitsetValidator(IsLoggableValidator validator)Sets a IsLoggableValidator implementation to be used. final static TaggedLoggergetLogger(String tag)Returns a tagged logger. final static Unite(String tag, Throwable throwable, Function0<String> message)Send a ERROR log message. final static Unite(String tag, Function0<String> message)Send a ERROR log message. final static Unitw(String tag, Function0<String> message)Send a WARN log message. final static Uniti(String tag, Function0<String> message)Send a INFO log message. final static Unitd(String tag, Function0<String> message)Send a DEBUG log message. final static Unitv(String tag, Function0<String> message)Send a VERBOSE log message. final static Unita(String tag, Function0<String> message)Send a ASSERT log message. final static Unitlog(Priority priority, String tag, Throwable throwable, Function0<String> message)Send a log message according to the priority. final static BooleanisInstalled()Represent a StreamLogger is already installed or not. -
-
Method Detail
-
install
final static Unit install(StreamLogger logger)
Installs a new StreamLogger implementation to be used.
-
unInstall
final static Unit unInstall()
Uninstall a previous StreamLogger implementation.
-
setValidator
final static Unit setValidator(IsLoggableValidator validator)
Sets a IsLoggableValidator implementation to be used.
-
getLogger
final static TaggedLogger getLogger(String tag)
Returns a tagged logger.
-
e
final static Unit e(String tag, Throwable throwable, Function0<String> message)
Send a ERROR log message.
- Parameters:
tag- Used to identify the source of a log message.throwable- An exception to log.message- The function returning a message you would like logged.
-
e
final static Unit e(String tag, Function0<String> message)
Send a ERROR log message.
- Parameters:
tag- Used to identify the source of a log message.message- The function returning a message you would like logged.
-
w
final static Unit w(String tag, Function0<String> message)
Send a WARN log message.
- Parameters:
tag- Used to identify the source of a log message.message- The function returning a message you would like logged.
-
i
final static Unit i(String tag, Function0<String> message)
Send a INFO log message.
- Parameters:
tag- Used to identify the source of a log message.message- The function returning a message you would like logged.
-
d
final static Unit d(String tag, Function0<String> message)
Send a DEBUG log message.
- Parameters:
tag- Used to identify the source of a log message.message- The function returning a message you would like logged.
-
v
final static Unit v(String tag, Function0<String> message)
Send a VERBOSE log message.
- Parameters:
tag- Used to identify the source of a log message.message- The function returning a message you would like logged.
-
a
final static Unit a(String tag, Function0<String> message)
Send a ASSERT log message.
- Parameters:
tag- Used to identify the source of a log message.message- The function returning a message you would like logged.
-
log
final static Unit log(Priority priority, String tag, Throwable throwable, Function0<String> message)
Send a log message according to the priority.
- Parameters:
priority- The priority/type of this log message.tag- Used to identify the source of a log message.throwable- An exception to log.message- The function returning a message you would like logged.
-
isInstalled
final static Boolean isInstalled()
Represent a StreamLogger is already installed or not. Let you know if the internal StreamLogger instance used for logs has been initialized or it is using the default one.
-
-
-
-