[bind10-dev] Proposed logging system enhancements
Stephen Morris
stephen at isc.org
Tue May 3 10:48:22 UTC 2011
On 29/04/2011 16:11, Michal 'vorner' Vaner wrote:
> Hello
>
> While writing #744 (yes, it takes some time, read all the code in data source
> library and add debug information and errors to it),
It's surprising how long it takes! :-)
> ...I'm thinking of few minor
> improvements we could do in the logging system.
>
> • The message definition format uses + to indicate a description of the logging
> statement, while it has no mark to indicate the real logging item. But the
> logging item is usually single line, while the description is multiline. So
> there are many + signs that disturb rewrap functions (at last the one in my
> vim, if I try to add/remove some words in the middle, I need to wrap the lines
> manually). Could we change it and have something like % denote start of new
> item and then the rest until the new item would be description?
So what you're suggesting is that instead of:
OPENIN error opening %s for input: %s
+ The system has not been able to open the named file for
+ input because of the problem given in the error message.
OPENOUT error opening %s for output: %s
:
... we would have:
% OPENIN error opening %s for input: %s
The system has not been able to open the named file for
input because of the problem given in the error message.
% OPENOUT error opening %s for output: %s
:
That's fine by me. It will be easy to alter the message compiler, and
with this scheme it is easy enough to identify the description text for
the (yet to be written) tool that creates the messages manual.
> • There's the prefix. But it's used only in the source code, where it's put into
> a namespace already, so it's not needed there. But when two libraries with
> different prefixes meet in the same system (it might happen that there are two
> independent people, each one publishing his own extensions), there's a
> problem. So, could we use the prefix in the internal identifiers and log
> outputs as well? Because that's the place where we don't have namespace.
I have to admit that I'm coming to the same conclusion. Although the
logging library will identify clashes during initialization (the current
logger initialization code will print warning messages about each
duplicate ID detected), it has struck me that people are likely to come
up with the same IDs for similar errors (e.g. I would regard the OPENIN
and OPENOUT as "obvious" IDs for errors opening files for input and output).
Again, it is a fairly small change to the message compiler to include
the prefix in the symbol ID.
Stephen
More information about the bind10-dev
mailing list