Documentation
¶
Overview ¶
Package logsafe makes a value safe to write into a log line.
A log is read by people and by machines that split it into records. A value carrying a newline can therefore forge a record — a refusal that looks like a success, an identity that was never there — and the values most worth logging are exactly the ones that came from outside: an address a gateway forwarded, a path a caller chose, the text of an error built from either.
Structured handlers escape these already, which is why nothing here has ever been forgeable in practice. This makes it true by construction instead of by the handler's choice, and names the intent where it can be seen.
Index ¶
Constants ¶
const Limit = 256
Limit is how much of a value is kept. Long enough for an address, a method name or a sentence; short enough that one field cannot bury a record.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.