Class DittoLog
java.lang.Object
com.ditto.java.DittoLog
Main access for Ditto logging API.
This class provides static methods for logging at various levels (error, warning, info,
debug, verbose). It is expected to be an internal one, although it cannot be marked as such
since it is used by other packages (e.g., ditto, androidtransports).
Tweaking its behavior, however (custom log callback, log file, log level, etc.),
is intended to be public / customer facing.
That part is thus defined as being part of ditto (our current public-facing package),
as the DittoLogging singleton.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidLogs a debug message.static voidLogs a debug message with an associated throwable.static voidLogs an error message.static voidLogs an error message with an associated throwable.static @NonNull DittoLogDecoratorReturns the current log decorator used for formatting log messages.static voidLogs an informational message.static voidLogs an informational message with an associated throwable.static voidsetLogDecorator(@NonNull DittoLogDecorator logDecorator) Sets a custom log decorator for formatting log messages.static voidLogs a verbose message.static voidLogs a verbose message with an associated throwable.static voidLogs a warning message.static voidLogs a warning message with an associated throwable.
-
Method Details
-
getLogDecorator
Returns the current log decorator used for formatting log messages.- Returns:
- the current
DittoLogDecoratorinstance.
-
setLogDecorator
Sets a custom log decorator for formatting log messages.- Parameters:
logDecorator- theDittoLogDecoratorto use for log message formatting.
-
e
-
e
Logs an error message with an associated throwable.- Parameters:
tag- a tag to identify the source of the log message.obj- the message object to log.throwable- an optional throwable associated with the error.
-
w
-
w
Logs a warning message with an associated throwable.- Parameters:
tag- a tag to identify the source of the log message.obj- the message object to log.throwable- an optional throwable associated with the warning.
-
i
-
i
Logs an informational message with an associated throwable.- Parameters:
tag- a tag to identify the source of the log message.obj- the message object to log.throwable- an optional throwable associated with the info message.
-
d
-
d
Logs a debug message with an associated throwable.- Parameters:
tag- a tag to identify the source of the log message.obj- the message object to log.throwable- an optional throwable associated with the debug message.
-
v
-
v
Logs a verbose message with an associated throwable.- Parameters:
tag- a tag to identify the source of the log message.obj- the message object to log.throwable- an optional throwable associated with the verbose message.
-