-
- 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 BooleandefaultLoggerOverriddenpublic final static StreamLogINSTANCE
-
Method Summary
Modifier and Type Method Description final static UnitsetLogger(StreamLogger logger)Sets a StreamLogger implementation to be used. 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 BooleangetDefaultLoggerOverridden()Let you know if the internal StreamLogger instance used for logs has been initialized or it is using the default one -
-
Method Detail
-
setLogger
final static Unit setLogger(StreamLogger logger)
Sets a StreamLogger implementation to be used.
-
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.
-
getDefaultLoggerOverridden
final Boolean getDefaultLoggerOverridden()
Let you know if the internal StreamLogger instance used for logs has been initialized or it is using the default one
-
-
-
-