[bind10-dev] Enabling/disabling logging on per-message basis

Michal 'vorner' Vaner michal.vaner at nic.cz
Wed Feb 29 16:32:52 UTC 2012


Hello

We talked yesterday on the call about the possibility of enabling and disabling
of logging of specific message. So, it would mean you could set the logging to
info, but would be interested in THIS_SINGLE_DEBUG_MSG as well, so you could
enable that one and you're not interested in the
WARN_ABOUT_REMOTE_SERVER_BEING_STUPID, so you disable that one, because it spams
your logs. There was a discussion if it'd be really useful, but I think it might
be (and if not, it could still be a nice publicity thing, and I actually got the
idea from a friend who asked just for that). And I'd like to show it could be
implemented quite easily. I don't know what the consensus was (if any).

We have the LOG_DEBUG and similar macros. They first check if the log level is
enabled. The check could get another parameter ‒ the message ID ‒ and look into
a map<MessageID, boolean> if it is there. If it wasn't there, then it would work
the normal way, by the log level. If it was, the boolean there would be taken as
the override for the given message. If the user didn't set any of the overrides,
the map would be empty, so the lookup would be fast, having only small
performance impact (it would be negligible to the virtual call we have to the
isDebugEnabled, as the map is a template, therefore inlined).

And the configuration could be simple as well. A named set in the logger
configuration.

So, there'd be only little work on it (changing the is*Enabled, the macros and
python wrappers, add the loading).

Do you think it makes sense to create the ticket and tackle it sometime soon?

With regards

-- 
No, I will not change your lightbulb.

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20120229/71a05f90/attachment.bin>


More information about the bind10-dev mailing list