Carlos Carvalho wrote: > Simon Kelley ([email protected]) 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... Only a few, and it adds lots of copies of the string "DHCP:" to the binary. The ones which are obviously more concise could be changed.
> It's harder to do but it's only once... It's very hard to get translations done and kept up to date..... > > >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. Ah! That makes it easy for Olaf to achieve his original aim, assuming he uses sylog-ng. This change is less obviously right, the extra-bits in the syslog argument method can almost as easily be used to append to the actual message. That's pretty non-negotiable, but I'm happy to append or change the id, as people think best. Cheers, Simon. > > _______________________________________________ > Dnsmasq-discuss mailing list > [email protected] > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss >
