c18e3c462f
The is no specification logfmt, most implementations only unescape `\"` and leave `\n` as is when parsing. Some implementations like go-logfmt do escape newlines as `\n` (and other chars according to Go's escaping rules). This PR just escapes non-printable characters using rust's string literal rules; they are not perfect but they don't seem to be worse than other players. (If this bites us some more we will probably be better of switching to json log output format and then equip ourselves with some simple shell scripts to reformat the logs on the fly while we're streaming them from k8s) As a bonus point, this effectively simplifies the escaping code, possibly also speeding it up a bit since it doesn't have to call replace twice (although I don't know what magic would the rust compiler have done to this double replace). Closes #1791 Closes influxdata/k8s-iox#1 |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml |