[bind10-dev] Task 1005 - Check Logger Names in cfgmgr

Stephen Morris stephen at isc.org
Tue Jun 28 08:27:40 UTC 2011


On 27/06/2011 16:59, Michal 'vorner' Vaner wrote:
> Hello
> 
> On Mon, Jun 27, 2011 at 03:55:45PM +0100, Stephen Morris wrote:
>> A solution that occurs to be that should be simple to implement
>> (although not very elegant) is to maintain a list of valid logger names,
>> and check against it both when creating a logger and when configuring one.
>>
>> The list doesn't have to be a text file - it could be some hard-coded
>> list of names in the liblog library with an interface to access it from
>> both C++ and Python.  Of course, the list would need to be updated every
>> time a new logger was added to the code, but that is unlikely to be a
>> common occurrence.
> 
> That sounds error prone to me. 

Although you might forget to update the list when you add a logger, if
the logging code were to complain if it was asked to use one not in the
list, you should be able to catch the omission on the first run of the
associated unit test.

However, I will concede that something that doesn't involve updating a
separate list is preferable - I suggested this as something that should
be easy and quick to implement.

Stephen



More information about the bind10-dev mailing list