[bind10-dev] consider log4cplus for logging

Stephen Morris stephen at isc.org
Thu Apr 28 08:28:27 UTC 2011


On 27/04/2011 19:29, Michal 'vorner' Vaner wrote:

> Strange that the Qt folks got to the same conclusion (they have really nice
> support for it in QString, one can write things like
> QString("There are %1 people in the %2").arg(4).arg("Town")). So it makes me
> think if it works for them, it should work for us.

The Microsoft message file uses something similar.

> 
> Anyway, people might be more familiar with the % version, would it be problem to
> use that?

No - let's make it %1, %2 then.

> 
> But then we can't use variadic functions, because they don't provide the type
> (or we would have to convert everything to strings before).

I think the way to go is template member functions, within which the
arguments are converted to strings through boost::lexical_cast.

Of course, we wouldn't have the variadic functions but if we were to
assume that no function call would take more than five arguments (say)
we could overloaded versions of the output methods (info(), error()
etc.) for 0, 1, ... 5 arguments. (We can't supply defaults for template
arguments in method definitions.)  Tedious to write, but it should be
relatively easy to do.

Stephen



More information about the bind10-dev mailing list