Class XRLog
java.lang.Object
com.openhtmltopdf.util.XRLog
Utility class for using the java.util.logging package. Relies on the standard
configuration for logging, but gives easier access to the various logs
(plumbing.load, .init, .render)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate static booleanstatic final Stringstatic final Stringstatic final Stringprivate static XRLoggerprivate static Booleanstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XRLoggerprivate static voidinit()static booleanWhether logging is on or off.Returns a list of all loggers that will be accessed by XRLog.static voidlog(Level level, LogMessageId.LogMessageId0Param logMessageId) static voidlog(Level level, LogMessageId.LogMessageId0Param logMessageId, Throwable t) static voidlog(Level level, LogMessageId.LogMessageId1Param logMessageId, Object arg) static voidlog(Level level, LogMessageId.LogMessageId1Param logMessageId, Object arg, Throwable throwable) static voidlog(Level level, LogMessageId.LogMessageId2Param logMessageId, Object arg1, Object arg2) static voidlog(Level level, LogMessageId.LogMessageId2Param logMessageId, Object arg1, Object arg2, Throwable throwable) static voidlog(Level level, LogMessageId.LogMessageId3Param logMessageId, Object arg1, Object arg2, Object arg3) static voidlog(Level level, LogMessageId.LogMessageId3Param logMessageId, Object arg1, Object arg2, Object arg3, Throwable throwable) static voidlog(Level level, LogMessageId.LogMessageId4Param logMessageId, Object arg1, Object arg2, Object arg3, Object arg4) static voidlog(Level level, LogMessageId.LogMessageId5Param logMessageId, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) private static voidlog(Level level, LogMessageId logMessageId, boolean hasError, Object... args) private static StringregisterLoggerByName(String loggerName) static voidstatic voidsetLoggerImpl(XRLogger loggerImpl) static voidsetLoggingEnabled(boolean loggingEnabled) Turns logging on or off, without affecting logging configuration.
-
Field Details
-
LOGGER_NAMES
-
CONFIG
-
EXCEPTION
-
GENERAL
-
INIT
-
JUNIT
-
LOAD
-
MATCH
-
CASCADE
-
XML_ENTITIES
-
CSS_PARSE
-
LAYOUT
-
RENDER
-
initPending
private static volatile boolean initPending -
loggerImpl
-
loggingEnabled
-
-
Constructor Details
-
XRLog
public XRLog()
-
-
Method Details
-
registerLoggerByName
-
listRegisteredLoggers
Returns a list of all loggers that will be accessed by XRLog. Each entry is a String with a logger name, which can be used to retrieve the logger using the corresponding Logging API; example name might be "com.openhtmltopdf.render"- Returns:
- List of loggers, never null.
-
log
-
log
-
log
-
log
public static void log(Level level, LogMessageId.LogMessageId1Param logMessageId, Object arg, Throwable throwable) -
log
public static void log(Level level, LogMessageId.LogMessageId2Param logMessageId, Object arg1, Object arg2) -
log
public static void log(Level level, LogMessageId.LogMessageId2Param logMessageId, Object arg1, Object arg2, Throwable throwable) -
log
public static void log(Level level, LogMessageId.LogMessageId3Param logMessageId, Object arg1, Object arg2, Object arg3) -
log
-
log
-
log
-
log
-
init
private static void init() -
setLevel
-
isLoggingEnabled
public static boolean isLoggingEnabled()Whether logging is on or off.- Returns:
- Returns true if logging is enabled, false if not. Corresponds to configuration file property xr.util-logging.loggingEnabled, or to value passed to setLoggingEnabled(bool).
-
setLoggingEnabled
public static void setLoggingEnabled(boolean loggingEnabled) Turns logging on or off, without affecting logging configuration.- Parameters:
loggingEnabled- Flag whether logging is enabled or not; if false, all logging calls fail silently. Corresponds to configuration file property xr.util-logging.loggingEnabled
-
getLoggerImpl
-
setLoggerImpl
-