Package net.sourceforge.pmd.util.log
Interface PmdReporter
-
public interface PmdReporterFaç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 RuntimeExceptionerror(@Nullable Throwable cause, @Nullable String contextMessage, Object... formatArgs)Only one of the cause or the message can be null.default RuntimeExceptionerror(String message, Object... formatArgs)default RuntimeExceptionerror(Throwable error)default voiderrorEx(String message, Object[] formatArgs, Throwable error)default voiderrorEx(String message, Throwable error)default voidinfo(String message, Object... formatArgs)booleanisLoggable(org.slf4j.event.Level level)default voidlog(org.slf4j.event.Level level, String message, Object... formatArgs)voidlogEx(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.intnumErrors()Returns the number of errors reported on this instance.static PmdReporterquiet()Returns a reporter instance that does not output anything, but still counts errors.default voidwarn(String message, Object... formatArgs)default voidwarnEx(String message, Object[] formatArgs, Throwable error)default voidwarnEx(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.ERRORshould increment this number.
-
quiet
static PmdReporter quiet()
Returns a reporter instance that does not output anything, but still counts errors.
-
-