Mainly for internal use within the framework with Apache Commons Logging,
typically in the form of the spring-jcl bridge but also compatible
with other Commons Logging bridges.
| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the formatted valuethe value to format value, boolean whether to truncate the value at a length of 100 limitLength)Convenience variant of |
| public static String | Returns: the formatted valuethe value to be formatted value, int the max length, after which to truncate, or -1 for unlimited maxLength, boolean whether to replace newline and
control characters with placeholders replaceNewlinesAndControlCharacters)Format the given value via |
| public static void | traceDebug(Log
the logger to use to log the message logger, Function<Boolean, String> function that accepts a boolean set to the value
of messageFactory)Log#isTraceEnabled()Use this to log a message with different levels of detail (or different messages) at TRACE vs DEBUG log levels. |
| CONTROL_CHARACTER_PATTERN | back to summary |
|---|---|
| private static final Pattern CONTROL_CHARACTER_PATTERN | |
| NEWLINE_PATTERN | back to summary |
|---|---|
| private static final Pattern NEWLINE_PATTERN | |
| LogFormatUtils | back to summary |
|---|---|
| public LogFormatUtils() | |
| formatValue | back to summary |
|---|---|
| public static String formatValue(Object value, boolean limitLength) Convenience variant of | |
| formatValue | back to summary |
|---|---|
| public static String formatValue(Object value, int maxLength, boolean replaceNewlinesAndControlCharacters) Format the given value via | |
| traceDebug | back to summary |
|---|---|
| public static void traceDebug(Log logger, Function<Boolean, String> messageFactory) Use this to log a message with different levels of detail (or different messages) at TRACE vs DEBUG log levels. Effectively, a substitute for:
if (logger.isDebugEnabled()) {
String str = logger.isTraceEnabled() ? "..." : "...";
if (logger.isTraceEnabled()) {
logger.trace(str);
}
else {
logger.debug(str);
}
}
| |