-
- All Implemented Interfaces:
-
app.cash.paykit.logging.CashAppLogger
public final class CashAppLoggerImpl implements CashAppLogger
-
-
Constructor Summary
Constructors Constructor Description CashAppLoggerImpl()
-
Method Summary
Modifier and Type Method Description UnitlogVerbose(String tag, String msg)Log a message with level VERBOSE. UnitlogWarning(String tag, String msg)Log a message with level WARNING. UnitlogError(String tag, String msg, Throwable throwable)Log a message with level ERROR. List<CashAppLogEntry>retrieveLogs()Retrieve all logs. StringlogsAsString()Retrieves all logs, compiled as a single string. UnitsetListener(CashAppLoggerListener listener)Set a listener to be notified when a new log is added. UnitremoveListener()Remove the currently registered listener, if any. -
-
Method Detail
-
logVerbose
Unit logVerbose(String tag, String msg)
Log a message with level VERBOSE.
-
logWarning
Unit logWarning(String tag, String msg)
Log a message with level WARNING.
-
logError
Unit logError(String tag, String msg, Throwable throwable)
Log a message with level ERROR. Optionally include a Throwable to log along the error message.
-
retrieveLogs
List<CashAppLogEntry> retrieveLogs()
Retrieve all logs.
-
logsAsString
String logsAsString()
Retrieves all logs, compiled as a single string. Each log entry is separated by two newline characters. The format of each log entry is: "LEVEL: MESSAGE".
If you need more control over the format, use retrieveLogs instead.
-
setListener
Unit setListener(CashAppLoggerListener listener)
Set a listener to be notified when a new log is added.
-
removeListener
Unit removeListener()
Remove the currently registered listener, if any.
-
-
-
-