Class PdfLog
-
- All Implemented Interfaces:
public final class PdfLog
Logger used for logging inside PSPDFKit.
This API allows injection of custom Logger implementations that can be used to achieve custom logging strategies for PSPDFKit framework logs.
Note: The default Logger only logs messages with priority
Log#INFO
or higher to LogCat.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interface
PdfLog.LogPriority
Priority of log messages. Log priority defines verbosity of the message, from most verbose (VERBOSE to least (ASSERT).
Note: PdfLog defaults to logging logs with priority INFO and up.
public interface
PdfLog.Logger
Interface for custom loggers that can be registered in PdfLog to implement custom logging strategies.
-
Constructor Summary
Constructors Constructor Description PdfLog()
-
Method Summary
Modifier and Type Method Description static void
addLogger(@NonNull() PdfLog.Logger logger)
Adds new logger that will be notified of all logs emitted by PdfLog. static void
removeLogger(@NonNull() PdfLog.Logger logger)
Removes previously registered logger. static void
setLoggers(@NonNull() Collection<out PdfLog.Logger> loggers)
Sets loggers that will be notified of all logs emitted by PdfLog. static void
setLoggers(@NonNull() Array<PdfLog.Logger> loggers)
Sets loggers that will be notified of all logs emitted by PdfLog. static List<PdfLog.Logger>
getLoggers()
Returns loggers that are currently registered. static void
removeAllLoggers()
Removes all registered loggers. static void
v(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a VERBOSE log message. static void
v(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a VERBOSE log message. static void
v(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a VERBOSE log message. static void
d(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a DEBUG log message. static void
d(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a DEBUG log message. static void
d(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a DEBUG log message. static void
i(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a INFO log message. static void
i(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a INFO log message. static void
i(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a INFO log message. static void
w(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a WARN log message. static void
w(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a WARN log message. static void
w(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a WARN log message. static void
e(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a ERROR log message. static void
e(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a ERROR log message. static void
e(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a ERROR log message. -
-
Method Detail
-
addLogger
static void addLogger(@NonNull() PdfLog.Logger logger)
Adds new logger that will be notified of all logs emitted by PdfLog.
- Parameters:
logger
- Logger to add.
-
removeLogger
static void removeLogger(@NonNull() PdfLog.Logger logger)
Removes previously registered logger.
- Parameters:
logger
- Logger to remove.
-
setLoggers
static void setLoggers(@NonNull() Collection<out PdfLog.Logger> loggers)
Sets loggers that will be notified of all logs emitted by PdfLog. This method replaces all previously registered loggers.
-
setLoggers
static void setLoggers(@NonNull() Array<PdfLog.Logger> loggers)
Sets loggers that will be notified of all logs emitted by PdfLog. This method replaces all previously registered loggers.
-
getLoggers
@NonNull() static List<PdfLog.Logger> getLoggers()
Returns loggers that are currently registered.
-
removeAllLoggers
static void removeAllLoggers()
Removes all registered loggers. Effectively disables logging.
-
v
static void v(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a VERBOSE log message.
- Parameters:
tag
- Tag identifying the source of a log message.messageCallback
- Callback returning the log message.
-
v
static void v(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a VERBOSE log message.
- Parameters:
tag
- Tag identifying the source of a log message.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
v
static void v(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a VERBOSE log message.
- Parameters:
tag
- Tag identifying the source of a log message.t
- Optional exception to log.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
d
static void d(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a DEBUG log message.
- Parameters:
tag
- Tag identifying the source of a log message.messageCallback
- Callback returning the log message.
-
d
static void d(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a DEBUG log message.
- Parameters:
tag
- Tag identifying the source of a log message.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
d
static void d(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a DEBUG log message.
- Parameters:
tag
- Tag identifying the source of a log message.t
- Optional exception to log.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
i
static void i(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a INFO log message.
- Parameters:
tag
- Tag identifying the source of a log message.messageCallback
- Callback returning the log message.
-
i
static void i(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a INFO log message.
- Parameters:
tag
- Tag identifying the source of a log message.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
i
static void i(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a INFO log message.
- Parameters:
tag
- Tag identifying the source of a log message.t
- Optional exception to log.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
w
static void w(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a WARN log message.
- Parameters:
tag
- Tag identifying the source of a log message.messageCallback
- Callback returning the log message.
-
w
static void w(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a WARN log message.
- Parameters:
tag
- Tag identifying the source of a log message.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
w
static void w(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a WARN log message.
- Parameters:
tag
- Tag identifying the source of a log message.t
- Optional exception to log.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
e
static void e(@NonNull() String tag, @NonNull() Callable<String> messageCallback)
Logs a ERROR log message.
- Parameters:
tag
- Tag identifying the source of a log message.messageCallback
- Callback returning the log message.
-
e
static void e(@NonNull() String tag, @Nullable() String message, @NonNull() Array<Object> args)
Logs a ERROR log message.
- Parameters:
tag
- Tag identifying the source of a log message.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
e
static void e(@NonNull() String tag, @Nullable() Throwable t, @Nullable() String message, @NonNull() Array<Object> args)
Logs a ERROR log message.
- Parameters:
tag
- Tag identifying the source of a log message.t
- Optional exception to log.message
- The message to logged.args
- Optional arguments referenced by the format specifiers in the message.
-
-
-
-