[SSSD] [PATCH 3/4] Make DEBUG macro variadic

Nikolai Kondrashov Nikolai.Kondrashov at redhat.com
Wed Oct 16 20:15:41 UTC 2013


On 10/15/2013 07:24 PM, Jakub Hrozek wrote:
> On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
>> Finally if everybody agree they want to make this huge change, *then* I
>> absolutely want to see each change also change debug numbers from
>> numbers to the new macros. It makes no sense whatsoever to change the
>> DEBUG form and leave in old debug numbers that we have been
>> painstakingly changing little by little in the last few years.
>
> Sorry, forgot to reply here as well..
>
> I would actually prefer *not* to mass-convert the decimal debug levels,
> everywhere.
>
> The reason is that in the past we've used the levels quite randomly,
> so there is a lot of debug messages of not much importance with levels
> 1-3 and really a lot of messages with level 9, which should be mostly
> used by stuff like DBus tracing or ldb debug messages.
>
> I think that with the decimal numbers in place, the developer is much
> more likely to notice that a decimal level needs to be changed and
> change its level as appropriate that if there already was a
> hexa debug level, but wrong.
>
> I would agree with mass-converting (and then checking) modules that we
> are very stable and we are unlikely to touch them soon (sbus, confdb,
> the monitor itself, ...)

I would say that it is necessary to weigh harm from having two different kinds
of log levels across the whole code vs. harm of having some log levels wrong.

I don't have the data about how many of the log levels are wrong, but let's
say about 3% (please correct me if my guess is wrong). I can count amount of
old level use and it's about 39%.

Now, wrong levels have impact on debugging and troubleshooting. Whereas having
two kinds of log levels has mental load impact on developers having to
remember the mapping and convert them, but quite likely just not checking if
the old log level is correct just because it's an effort to convert.

I would say that 39% split in level kinds means that developers are confronted
with different DEBUG macro invocations almost on daily basis. Whereas 3% of
wrong levels would mean that about one in 30 debug sessions would suffer from
a missing or an extra log message, provided that most important and used
messages are correct. This is all, of course, are my uninformed guesses, so
substitute your numbers if they're different.

Based on the above I would say that having log level kinds normalized would
have a bigger impact on the project's well-being. Also, having a
single log level kind would make it easier for developers to check if a
particular level is correct.

Sincerely,
Nick

P.S. It would have been easier for me personally to keep up with the
      discussion, if the mailserver didn't strip recipients and everyone used
      "Reply to all". I'm not an sssd-devel reader normally and only read
      recent messages in the thread that I started, stumbling upon them by
      chance.



More information about the sssd-devel mailing list