[bind10-dev] Task 1005 - Check Logger Names in cfgmgr
Stephen Morris
stephen at isc.org
Mon Jun 27 14:55:45 UTC 2011
As noted in my previous email to the list, there was a significant
disagreement in the estimate for this task. As this may indicate a
differing understanding of the problem or of a potential solution, I'm
starting a new thread to discuss it. When we reach some consensus, I'll
ask for a re-estimate.
The task description says:
===
You can configure any logger, but if you mistype the name, it will
happily create a logger for a module that does not exist, and the ones
that do will use defaults.
So the plugin config checker should really check the name and see if it
makes sense.
However, there are a few problems;
right now the way those python checking scripts are called they have
no knowledge of what modules there are, so they can't really check the
names of the loggers.
even if they could, you would only be able to configure logging for
modules that are running (which is another symptom of the bigger 'can't
configure non-running modules')
so right now, i think we should modify the calling design so you can
actually check, but not error on a 'wrong' name, only log an error (yes
that sounds weird, in effect this error log message would go to the
'previous' config, or the default if nothing has been configured yet).
===
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.
Thoughts?
Stephen
More information about the bind10-dev
mailing list