David F. Skoll wrote: >Philip Prindeville wrote: > > > >>Oh... and in digging around, I saw: >>sub md_syslog ($$) { >> my($facility, $msg) = @_; >> >> > >[...] > > > >>Hmm... Klunky. What about: >> >> > > > >>sub md_syslog ($$;@) { >> my($facility, $fmt, @args) = @_; >> >> > >Except that now all callers of md_syslog have to change. That's no good. >Every single caller of md_syslog would have to ensure that its first argument >didn't contain any printf-sequences, and most calls would devolve to: > > md_syslog($facility, "%s", $msg); > >which is why I did it the first way originally. > >Regards, > >David. > >
Hmm. syslog() already has printf-style formatting... should the wrapper occlude that functionality? And what about callers that have to call sprintf directly if they want to handle multiple arguments? How likely is it that there are callers that pass "%" in the message string? I just did a quick inspection, and only places like: md_syslog("$GraphDefangSyslogFacility|info","MDLOG,$id," . "$event,$value1,$value2,$lcsender," . "$lcrecipient,$subj"); or: md_syslog('debug', $msg); or: md_syslog('err', "$MsgID: $errmsg"); or: md_syslog('warning', "Message contains more than one Subject: header: $Subject --> $arg"); seem to be issues, and they are easily enough rewritten. -Philip _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang