The dictionary API seems a totally wrong design, because it has redundant information, is incredibly cumbersome to use and thus is not likely to be used by anyone.
Then just output the format string and arguments separately instead of doing formatting in the kernel (and of course, emulate the old interface by doing it in the kernel on demand).
For info that shouldn't be in the human-readable output, add a special syntax such as %{subsys}s that doesn't output anything.
Posted Apr 14, 2012 18:48 UTC (Sat) by smurf (subscriber, #17840)
[Link]
This work until you happen to come across a substituted string which happens to contain a colon.
Your proposal also is much more complicated, for no tangible gain AFAICS.
Toward more reliable logging
Posted Apr 15, 2012 0:40 UTC (Sun) by slashdot (guest, #22014)
[Link]
You don't parse the colons...
The kernel sees "%[subsys]s" and adds the argument as the value of the "subsys" key, using the same format (or alternatively, just prints the unformatted format string, and userspace does the work).
This would make the API easy to use, compared to the patch which requires horrible code like this: