Re: [PATCH] Stop printk printing non-printable chars

Matthias Urlichs
2004-06-19T10:28:18Z

Hi, Willy Tarreau wrote:

> Another way to do it would be to display "<XX>" like less, but '<' and '>'
> are sensible because they're used to indicate the log level.

Umm, they're not sensible. (You're mixing up word meanings.)
Log levels are not a big problem, because the log level is always printed
first. Usually.

IMHO, the stuff should make sense to a human reader, and it should be
possible to figure out quickly and unambiguously what the random bit
pattern that inadvertently got printed actually *is*.

That means: Escape anything <\x31 except \n. Escape \\. Escape anything
with the 8th bit set. Use hex escapes \x## -- let's face it, they're as
long as octal and easier to read these days.

--
Matthias Urlichs