public final class

PdfLog

extends Object
java.lang.Object
   ↳ com.pspdfkit.utils.PdfLog

Class Overview

Logger used for logging inside PSPDFKit.

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


Note: The default PdfLog.Logger only logs messages with priority Log#INFO or higher to LogCat.

Summary

Nested Classes
@interface PdfLog.LogPriority

Priority of log messages. 

interface PdfLog.Logger Interface for custom loggers that can be registered in PdfLog to implement custom logging strategies. 
Public Constructors
PdfLog()
Public Methods
static void addLogger(PdfLog.Logger logger)
Adds new logger that will be notified of all logs emitted by PdfLog.
static void d(String tag, Throwable t, String message, Object... args)
Logs a DEBUG log message.
static void d(String tag, Callable<String> messageCallback)
Logs a DEBUG log message.
static void d(String tag, String message, Object... args)
Logs a DEBUG log message.
static void e(String tag, String message, Object... args)
Logs a ERROR log message.
static void e(String tag, Callable<String> messageCallback)
Logs a ERROR log message.
static void e(String tag, Throwable t, String message, Object... args)
Logs a ERROR log message.
static List<PdfLog.Logger> getLoggers()
Returns loggers that are currently registered.
static void i(String tag, String message, Object... args)
Logs a INFO log message.
static void i(String tag, Callable<String> messageCallback)
Logs a INFO log message.
static void i(String tag, Throwable t, String message, Object... args)
Logs a INFO log message.
static void removeAllLoggers()
Removes all registered loggers.
static void removeLogger(PdfLog.Logger logger)
Removes previously registered logger.
static void setLoggers(Logger... loggers)
Sets loggers that will be notified of all logs emitted by PdfLog.
static void setLoggers(Collection<? extends PdfLog.Logger> loggers)
Sets loggers that will be notified of all logs emitted by PdfLog.
static void v(String tag, Callable<String> messageCallback)
Logs a VERBOSE log message.
static void v(String tag, String message, Object... args)
Logs a VERBOSE log message.
static void v(String tag, Throwable t, String message, Object... args)
Logs a VERBOSE log message.
static void w(String tag, Throwable t, String message, Object... args)
Logs a WARN log message.
static void w(String tag, Callable<String> messageCallback)
Logs a WARN log message.
static void w(String tag, String message, Object... args)
Logs a WARN log message.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PdfLog ()

Public Methods

public static void addLogger (PdfLog.Logger logger)

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

Parameters
logger Logger to add.

public static void d (String tag, Throwable t, String message, 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. See String#format(String, Object...) for more details.

public static void d (String tag, Callable<String> messageCallback)

Logs a DEBUG log message.

Parameters
tag Tag identifying the source of a log message.
messageCallback Callback returning the log message. Called only when the log is accepted by any registered logger via isLogged(int, String).

public static void d (String tag, String message, 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. See String#format(String, Object...) for more details.

public static void e (String tag, String message, 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. See String#format(String, Object...) for more details.

public static void e (String tag, Callable<String> messageCallback)

Logs a ERROR log message.

Parameters
tag Tag identifying the source of a log message.
messageCallback Callback returning the log message. Called only when the log is accepted by any registered logger via isLogged(int, String).

public static void e (String tag, Throwable t, String message, 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. See String#format(String, Object...) for more details.

public static List<PdfLog.Logger> getLoggers ()

Returns loggers that are currently registered.

public static void i (String tag, String message, 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. See String#format(String, Object...) for more details.

public static void i (String tag, Callable<String> messageCallback)

Logs a INFO log message.

Parameters
tag Tag identifying the source of a log message.
messageCallback Callback returning the log message. Called only when the log is accepted by any registered logger via isLogged(int, String).

public static void i (String tag, Throwable t, String message, 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. See String#format(String, Object...) for more details.

public static void removeAllLoggers ()

Removes all registered loggers. Effectively disables logging.

public static void removeLogger (PdfLog.Logger logger)

Removes previously registered logger.

Parameters
logger Logger to remove.

public static void setLoggers (Logger... loggers)

Sets loggers that will be notified of all logs emitted by PdfLog. This method replaces all previously registered loggers.

public static void setLoggers (Collection<? extends PdfLog.Logger> loggers)

Sets loggers that will be notified of all logs emitted by PdfLog. This method replaces all previously registered loggers.

public static void v (String tag, Callable<String> messageCallback)

Logs a VERBOSE log message.

Parameters
tag Tag identifying the source of a log message.
messageCallback Callback returning the log message. Called only when the log is accepted by any registered logger via isLogged(int, String).

public static void v (String tag, String message, 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. See String#format(String, Object...) for more details.

public static void v (String tag, Throwable t, String message, 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. See String#format(String, Object...) for more details.

public static void w (String tag, Throwable t, String message, 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. See String#format(String, Object...) for more details.

public static void w (String tag, Callable<String> messageCallback)

Logs a WARN log message.

Parameters
tag Tag identifying the source of a log message.
messageCallback Callback returning the log message. Called only when the log is accepted by any registered logger via isLogged(int, String).

public static void w (String tag, String message, 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. See String#format(String, Object...) for more details.