On Wednesday 14 January 2004 02:08 CET Malte S. Stretz wrote:
> On Wednesday 14 January 2004 01:38 CET Justin Mason wrote:
> > OK -- one problem here -- we shouldn't make that conditional if
> > possible, as it will confuse log parsers. Is there a way we can avoid
> > that?
>
> Hmmm... changing the log format will probably break the log parsers
> anyway, I should have thoought about that. Maybe that's why I chose to
> put the stuff inside brackets intuitively ;-) But it just came into my
> mind that the MID is replaced with "(unknown)" if none was given... Hm.
Ok, I changed this (r6171), it's now
logmsg = ("processing" | "checking")
WSP "message" WSP (("<" msgid ">") | "(unknown)")
[ WSP "aka" WSP "<" resent-msgid ">" ]
WSP "for" WSP (uname | "(unknown)") ":" uid
"."
So parsing the log line is more or less like the trace headers: You've got a
keyword (currently "message", "aka" (anybody got a better name for this?)
and "for") followed by a space and the value. The value is either anything
between a matching pair of brackets ("<...>", "(...)", "[...]"), a quoted
string or some chars (without a space of course). That should be enough
forward-compatible for any reasonable parser. I think I'll put a note about
this into some doc.
Cheers,
Malte
--
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
<http://www.catb.org/~esr/faqs/smart-questions.html>