com.openhtmltopdf.util.Diagnostic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openhtmltopdf-core Show documentation
Show all versions of openhtmltopdf-core Show documentation
Open HTML to PDF is a CSS 2.1 renderer written in Java. This artifact contains the core rendering and layout code.
package com.openhtmltopdf.util;
import java.util.logging.Level;
public class Diagnostic {
private final Level level;
private final LogMessageId logMessageId;
private final Object[] args;
private final Throwable error;
Diagnostic(Level level, LogMessageId logMessageId, boolean hasError, Object[] args) {
this.level = level;
this.logMessageId = logMessageId;
this.args = args;
this.error = hasError ? (Throwable) args[args.length - 1] : null;
}
public LogMessageId getLogMessageId() {
return logMessageId;
}
public Level getLevel() {
return level;
}
public boolean hasError() {
return error != null;
}
public Throwable getError() {
return error;
}
public String getFormattedMessage() {
return logMessageId.formatMessage(args);
}
public Object[] getArgs() {
return args;
}
}