Package net.sourceforge.pmd.util.log
Interface PmdReporter
-
public interface PmdReporter
Façade to report user-facing messages (info, warning and error).Note: messages are formatted using
MessageFormat
.Note: This interface was called net.sourceforge.pmd.util.log.MessageReporter in PMD 6.
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RuntimeException
error(@Nullable Throwable cause, @Nullable String contextMessage, Object... formatArgs)
Only one of the cause or the message can be null.default RuntimeException
error(String message, Object... formatArgs)
default RuntimeException
error(Throwable error)
default void
errorEx(String message, Object[] formatArgs, Throwable error)
default void
errorEx(String message, Throwable error)
default void
info(String message, Object... formatArgs)
boolean
isLoggable(org.slf4j.event.Level level)
default void
log(org.slf4j.event.Level level, String message, Object... formatArgs)
void
logEx(org.slf4j.event.Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error)
default RuntimeException
newException(org.slf4j.event.Level level, @Nullable Throwable cause, @Nullable String message, Object... formatArgs)
Logs and returns a new exception.int
numErrors()
Returns the number of errors reported on this instance.static PmdReporter
quiet()
Returns a reporter instance that does not output anything, but still counts errors.default void
warn(String message, Object... formatArgs)
default void
warnEx(String message, Object[] formatArgs, Throwable error)
default void
warnEx(String message, Throwable error)
-
-
-
Method Detail
-
isLoggable
boolean isLoggable(org.slf4j.event.Level level)
-
logEx
void logEx(org.slf4j.event.Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error)
-
newException
default RuntimeException newException(org.slf4j.event.Level level, @Nullable Throwable cause, @Nullable String message, Object... formatArgs)
Logs and returns a new exception. Message and cause may not be null a the same time.
-
error
default RuntimeException error(String message, Object... formatArgs)
-
error
default RuntimeException error(@Nullable Throwable cause, @Nullable String contextMessage, Object... formatArgs)
Only one of the cause or the message can be null.
-
error
default RuntimeException error(Throwable error)
-
numErrors
int numErrors()
Returns the number of errors reported on this instance. Any call tolog(Level, String, Object...)
orlogEx(Level, String, Object[], Throwable)
with a level ofLevel.ERROR
should increment this number.
-
quiet
static PmdReporter quiet()
Returns a reporter instance that does not output anything, but still counts errors.
-
-