PdfLog

object PdfLog

Logger used for logging inside Nutrient.

This API allows injection of custom Logger implementations that can be used to achieve custom logging strategies for PSPDFKit framework logs.

Note: In a debuggable app the default Logger logs Log.DEBUG and above; in a release app it logs Log.INFO and above.

Types

Link copied to clipboard
fun interface Logger

Interface for custom loggers that can be registered in PdfLog to implement custom logging strategies.

Link copied to clipboard
annotation class LogPriority

Priority of log messages. Log priority defines verbosity of the message, from most verbose (Log.VERBOSE) to least (Log.ASSERT).

Functions

Link copied to clipboard

Adds a new logger that will be notified of all logs emitted by PdfLog.

Link copied to clipboard
fun d(tag: String, messageCallback: Callable<String>)

Logs a Log.DEBUG message. The messageCallback is invoked only when the log is accepted by a registered logger via Logger.isLogged.

fun d(tag: String, message: String?, vararg args: Any?)

Logs a Log.DEBUG message, with optional String.format for message.

fun d(tag: String, t: Throwable?, message: String?, vararg args: Any?)

Logs a Log.DEBUG message with an optional throwable t, and optional String.format.

Link copied to clipboard
fun e(tag: String, messageCallback: Callable<String>)

Logs an Log.ERROR message. The messageCallback is invoked only when the log is accepted by a registered logger via Logger.isLogged.

fun e(tag: String, message: String?, vararg args: Any?)

Logs an Log.ERROR message, with optional String.format for message.

fun e(tag: String, t: Throwable?, message: String?, vararg args: Any?)

Logs an Log.ERROR message with an optional throwable t, and optional String.format.

Link copied to clipboard

Returns an immutable snapshot of the currently registered loggers.

Link copied to clipboard
fun i(tag: String, messageCallback: Callable<String>)

Logs an Log.INFO message. The messageCallback is invoked only when the log is accepted by a registered logger via Logger.isLogged.

fun i(tag: String, message: String?, vararg args: Any?)

Logs an Log.INFO message, with optional String.format for message.

fun i(tag: String, t: Throwable?, message: String?, vararg args: Any?)

Logs an Log.INFO message with an optional throwable t, and optional String.format.

Link copied to clipboard

Removes all registered loggers. Effectively disables logging.

Link copied to clipboard

Removes a previously registered logger.

Link copied to clipboard
fun setLoggers(vararg loggers: PdfLog.Logger)

Sets the loggers notified of all logs emitted by PdfLog, replacing all previously registered ones.

Link copied to clipboard
fun v(tag: String, messageCallback: Callable<String>)

Logs a Log.VERBOSE message. The messageCallback is invoked only when the log is accepted by a registered logger via Logger.isLogged.

fun v(tag: String, message: String?, vararg args: Any?)

Logs a Log.VERBOSE message, with optional String.format for message.

fun v(tag: String, t: Throwable?, message: String?, vararg args: Any?)

Logs a Log.VERBOSE message with an optional throwable t, and optional String.format.

Link copied to clipboard
fun w(tag: String, messageCallback: Callable<String>)

Logs a Log.WARN message. The messageCallback is invoked only when the log is accepted by a registered logger via Logger.isLogged.

fun w(tag: String, message: String?, vararg args: Any?)

Logs a Log.WARN message, with optional String.format for message.

fun w(tag: String, t: Throwable?, message: String?, vararg args: Any?)

Logs a Log.WARN message with an optional throwable t, and optional String.format.