But the sscanf parsing is fragile if not impossible to get right in some
cases. How do you parse the output of printk("file %s on device %s
corrupted", file, devname); if file the file contains spaces and whatever?
Why not make it so that kernel can be configured to output messages as
<format string>,<arg>,<arg>... where the format string is what is usually
passed to *printf. (The actual field separators could be \0 or something.)
Then you can use standard gnu gettext to get the translation in user space
(i18n aware klogd, whatever) and apply the formatting after that.
Actually, the structured message pool could be separate from the normal one,
so that the existing tools don't break. Both the old style and formatted
message pool could be configured on and off based on user needs when
compiling the kernel.
And the change should be pretty easy and centralized in kernel. This only
adds the run time over head of maintaing two pools iff both are configured
on.
(Not that I need i18n kernel or would ever use one. And I'm fairly sure
no-one gets around to implement it anyway...)
-- v --
v@iki.fi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/