public class ViewerLogger extends Object
The ViewerLogger class provides functionality to log messages to an integrated or user-defined logger.
It serves as the global logger for the viewer module and can be used to log various events and messages.
Example usage:
// Configure the viewer logger to use the default integrated logger
ViewerLogger.setLogger(new FileLogger("/path/to/file.log"));
// Log an debug message
ViewerLogger.debug("Debug message");
// Log an error message
ViewerLogger.error("Error message");
Note: The ViewerLogger class can be configured to use a custom logger implementation by calling the setLogger(ILogger) method.
By default, it uses the integrated logger provided by the viewer module.
FileLogger| Constructor and Description |
|---|
ViewerLogger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
debug(String message,
Object... arguments)
Writes a debug log message to the console.
|
static void |
debug(Throwable throwable,
String message,
Object... arguments)
Writes a debug log message to the console.
|
static void |
error(String message,
Object... arguments)
Writes an error log message to the console.
|
static void |
error(Throwable throwable,
String message,
Object... arguments)
Writes an error log message to the console.
|
static com.groupdocs.foundation.logging.ILogger |
getLogger()
Gets the logger instance that will be used for logging messages.
|
static boolean |
isDebugEnabled()
Checks if the debug level is enabled for logging.
|
static boolean |
isErrorEnabled()
Checks if error-level logging is enabled.
|
static boolean |
isTraceEnabled()
Checks if the trace level is enabled for logging.
|
static boolean |
isWarningEnabled()
Checks if the warning level is enabled for logging.
|
static void |
setLogger(com.groupdocs.foundation.logging.ILogger logger)
Sets the logger instance that will be used for logging messages.
|
static void |
trace(String message,
Object... arguments)
Writes a trace message to the console.
|
static void |
trace(Throwable throwable,
String message,
Object... arguments)
Writes a trace log message to the console.
|
static void |
warning(String message,
Object... arguments)
Writes a warning log message to the console.
|
static void |
warning(Throwable throwable,
String message,
Object... arguments)
Writes a warning log message to the console.
|
public static void debug(String message, Object... arguments)
Writes a debug log message to the console. Debug log messages provide information about different processes in the application flow.
message - The debug log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.public static void debug(Throwable throwable, String message, Object... arguments)
Writes a debug log message to the console. Debug log messages provide information about different processes in the application flow.
message - The debug log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.throwable - The exception associated with the debug log message.public static void error(String message, Object... arguments)
Writes an error log message to the console. Error log messages provide information about unrecoverable events in the application flow.
message - The error log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.public static void error(Throwable throwable, String message, Object... arguments)
Writes an error log message to the console. Error log messages provide information about unrecoverable events in the application flow.
throwable - The exception associated with the error log message.message - The error log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.public static com.groupdocs.foundation.logging.ILogger getLogger()
Gets the logger instance that will be used for logging messages. The logger instance can be used to log messages of different levels such as trace, debug, warning, and error.
public static boolean isDebugEnabled()
Checks if the debug level is enabled for logging.
true if the debug level is enabled, false otherwise.public static boolean isErrorEnabled()
true if error-level logging is enabled, false otherwise.public static boolean isTraceEnabled()
Checks if the trace level is enabled for logging.
true if the trace level is enabled, false otherwise.public static boolean isWarningEnabled()
Checks if the warning level is enabled for logging.
true if the warning level is enabled, false otherwise.public static void setLogger(com.groupdocs.foundation.logging.ILogger logger)
Sets the logger instance that will be used for logging messages. The logger instance can be used to log messages of different levels such as trace, debug, warning, and error.
logger - The logger instance to set.public static void trace(String message, Object... arguments)
Writes a trace message to the console. Trace log messages provide generally useful information about application flow.
message - The trace message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in order of passing.public static void trace(Throwable throwable, String message, Object... arguments)
Writes a trace log message to the console. Trace log messages provide generally useful information about the application flow.
throwable - The exception associated with the trace log message.message - The trace log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.public static void warning(String message, Object... arguments)
Writes a warning log message to the console. Warning log messages provide information about unexpected and recoverable events in the application flow.
message - The warning log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.public static void warning(Throwable throwable, String message, Object... arguments)
Writes a warning log message to the console. Warning log messages provide information about unexpected and recoverable events in the application flow.
throwable - The exception associated with the warning log message.message - The warning log message.arguments - The arguments to be replaced in the message. They will replace {} placeholders in the order they are passed.Copyright © 2025. All rights reserved.