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
Modifier and TypeMethodDescriptiondefault RuntimeExceptionOnly one of the cause or the message can be null.default RuntimeExceptiondefault RuntimeExceptiondefault voiddefault voiddefault voidbooleanisLoggable(org.slf4j.event.Level level) default voidvoidlogEx(org.slf4j.event.Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error) default RuntimeExceptionnewException(org.slf4j.event.Level level, @Nullable Throwable cause, @Nullable String message, Object... formatArgs) Logs and returns a new exception.intReturns the number of errors reported on this instance.static PmdReporterquiet()Returns a reporter instance that does not output anything, but still counts errors.default voiddefault voiddefault void
-
Method Details
-
isLoggable
boolean isLoggable(org.slf4j.event.Level level) -
log
-
logEx
-
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. -
info
-
warn
-
warnEx
-
warnEx
-
error
-
error
default RuntimeException error(@Nullable Throwable cause, @Nullable String contextMessage, Object... formatArgs) Only one of the cause or the message can be null. -
error
-
errorEx
-
errorEx
-
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.ERRORshould increment this number. -
quiet
Returns a reporter instance that does not output anything, but still counts errors.
-