[Dnsmasq-discuss] Patch to change dnsmasq logentries
Carlos Carvalho
carlos at fisica.ufpr.br
Fri Feb 27 16:28:04 GMT 2009
Simon Kelley (simon at thekelleys.org.uk) wrote on 27 February 2009 15:44:
>I'm happy with the general principle, but the method you have used has
>the effect of changing LOTS of literal strings in the code. That makes
>large amounts of the translations out of date, when the messages have
>not really changed at all.
>
>As an alternative, how about using some of the log-facility bits in the
>first argument of my_syslog, and appending the extra text in the
>my_syslog code.
>
>
>#define MS_TFTP LOG_LOCAL0
>#define MS_DHCP LOG_LOCAL1
>
>my_syslog(MS_DHCP | LOG_WARNING, _("Ignoring domain %s for DHCP host
>name %s"), config_domain, hostname);
>
>in my_syslog()
>
>if (level | MS_DHCP)
> { extratext = "DHCP";
> level &= ~MS_DHCP;
> }
>
>etc..
OTOH, changing the strings will make the logs more concise... It's
harder to do but it's only once...
>Also, I suspect that there are quite a few people doing pattern-matching
>on the log strings, maybe it would be less likely to break that if the
>sub-function was added to the ident:
>
>Feb 27 07:38:41 fw dnsmasq-dhcp[29780]: DHCPREQUEST(lan-1) 192.168.10.44
>00:3F:56:20:11:f1
This will break those that select by the program name, for example in
syslog-ng. Changing anything in the log will likely break someone
somewhere. Olaf's proposal might be less intrusive in this respect.
More information about the Dnsmasq-discuss
mailing list