[bind10-dev] include severity name and debug level in .mes definitions and log output
Stephen Morris
stephen at isc.org
Tue Aug 23 14:21:41 UTC 2011
On 23/08/2011 14:30, Michal 'vorner' Vaner wrote:
> Hello
>
> On Tue, Aug 23, 2011 at 08:12:26AM -0500, Jeremy C. Reed wrote:
>> 1) an admin could customize them without patching real code;
>
> I'd like to note that the admin would still need to recompile the
> binaries, since the messages are compiled in (and so should be the
> severities). The program doesn't read the original mes files.
Not quite true. The capability exists to have .mes files read when
logging is initialized. The description text in these files
overwrites the compiled-in text. However, the code to make use of
this capability (i.e. get the name of the .mes file from the
configuration database and actually call the method to read it) has
not been written yet.
But do we want to allow this? There are guidelines as to use of the
message severity:
FATAL - an error so severe that the program cannot continue.
ERROR - the program can continue but the results are not guaranteed
correct
WARN - an unusual event happened, although the program is working normally
INFO - a significant event has happened that should be recorded
DEBUG - debugging output
(see src/lib/log/README)
The developer is best placed to determine the impact of a condition
being logged,. To allow a local admin to override this could cause
problems for support.
> And: 3) The code could get slightly shorter, because log calls are
> ones of the longest ones. It's partly because there need to be
> bunch of parameters, but the severity must be there as well.
>
> However, I'm little bit worried about performance hit of this
> change. We could design it in a way this is small or none at all,
> but we must be careful.
There would be some impact. All logging output is currently via the
construct
if (logging_enabled_at_this_severity_and_debuglevel) {
get_text_process_arguments_and_log_message
}
The message dictionary (to look up the message text) is not accessed
unless the message will be output. If the severity and debug level
were associated with the message (and could be overridden by the
user), then at the very least each logging call would require a lookup
of the message in the dictionary to get that information. Admittedly
this is just the lookup of a string in a std::map, but it would be
executed for every logging call, even those that did not produce output.
Stephen
More information about the bind10-dev
mailing list