Re: [PATCH] Stop printk printing non-printable chars
From: Matthias Urlichs
Date: Sat Jun 19 2004 - 05:29:38 EST
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/