Formats values for log lines: what the framework writes about values from outside (a path, a user name, a header) goes through it.
A value from a client can hold line breaks and terminal escapes: logged
as it is, ada\nINFO ... root logged in would add a forged line to the
log, and an escape code would change what a terminal shows. formatValue
replaces them, and cuts long values.
Spring (Java): org.springframework.core.log.LogFormatUtils.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
formatValue(
Object? value, {int maxLength = 100, bool replaceNewlinesAndControlCharacters = true}) → String -
valuefor a log line: aStringin quotes,nullasnull, anything else bytoString(); cut tomaxLengthcharacters (-1: no limit) followed by(truncated)...; withreplaceNewlinesAndControlCharacters(the default here),\nand\ras<EOL>and every other control character (\p{Cc}, escape codes included) as?, as Spring.