13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
+
16
17
package org .springframework .core .log ;
17
18
18
19
import java .util .function .Function ;
@@ -42,16 +43,16 @@ private LogFormatUtils() {
42
43
* {@link CharSequence}, and possibly truncating at 100 if limitLength is
43
44
* set to true.
44
45
* @param value the value to format
45
- * @param limitLength whether to truncate large formatted values (over 100).
46
+ * @param limitLength whether to truncate large formatted values (over 100)
46
47
* @return the formatted value
47
48
* @since 5.1
48
49
*/
49
50
public static String formatValue (@ Nullable Object value , boolean limitLength ) {
50
51
if (value == null ) {
51
52
return "" ;
52
53
}
53
- String s = value instanceof CharSequence ? "\" " + value + "\" " : value .toString ();
54
- return limitLength && s .length () > 100 ? s .substring (0 , 100 ) + " (truncated)..." : s ;
54
+ String s = ( value instanceof CharSequence ? "\" " + value + "\" " : value .toString () );
55
+ return ( limitLength && s .length () > 100 ? s .substring (0 , 100 ) + " (truncated)..." : s ) ;
55
56
}
56
57
57
58
/**
@@ -70,7 +71,7 @@ public static String formatValue(@Nullable Object value, boolean limitLength) {
70
71
* </pre>
71
72
* @param logger the logger to use to log the message
72
73
* @param messageFactory function that accepts a boolean set to the value
73
- * of {@link Log#isTraceEnabled()}.
74
+ * of {@link Log#isTraceEnabled()}
74
75
*/
75
76
public static void traceDebug (Log logger , Function <Boolean , String > messageFactory ) {
76
77
if (logger .isDebugEnabled ()) {
0 commit comments