Package net.sourceforge.pmd.util.log
Interface MessageReporter
-
@InternalApi public interface MessageReporter
Façade to report user-facing messages (info, warning and error). Note: messages are formatted usingMessageFormat
.Internal API: this is a transitional API that will be significantly changed in PMD 7, with the transition to SLF4J. See https://github.com/pmd/pmd/issues/3816
- Author:
- Clément Fournier
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MessageReporter.Level
Deprecated.Will be replaced with SLF4J Level in PMD 7
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
error(String message, Object... formatArgs)
void
errorEx(String message, Object[] formatArgs, Throwable error)
void
errorEx(String message, Throwable error)
void
info(String message, Object... formatArgs)
boolean
isLoggable(MessageReporter.Level level)
void
log(MessageReporter.Level level, String message, Object... formatArgs)
void
logEx(MessageReporter.Level level, String message, Object[] formatArgs, Throwable error)
int
numErrors()
Returns the number of errors reported on this instance.void
trace(String message, Object... formatArgs)
Deprecated.Trace messages should be reported on a Logger instance.void
warn(String message, Object... formatArgs)
void
warnEx(String message, Object[] formatArgs, Throwable error)
void
warnEx(String message, Throwable error)
-
-
-
Method Detail
-
isLoggable
boolean isLoggable(MessageReporter.Level level)
-
log
void log(MessageReporter.Level level, String message, Object... formatArgs)
-
logEx
void logEx(MessageReporter.Level level, String message, Object[] formatArgs, Throwable error)
-
trace
@Deprecated void trace(String message, Object... formatArgs)
Deprecated.Trace messages should be reported on a Logger instance. This is kept because it's simpler to port calls to this method to SLF4J in PMD 7 than to do the same if these calls were calls to a java.util.logging.Logger in PMD 6.
-
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 ofMessageReporter.Level.ERROR
should increment this number.
-
-