]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: add a library notice log level print
authorLuis Chamberlain <mcgrof@kernel.org>
Tue, 10 Aug 2021 05:16:00 +0000 (22:16 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 23 Sep 2021 07:59:38 +0000 (00:59 -0700)
commit43bdf97ce1298c8727effb470291ed884e1161e6
tree048da3204e38655bcb2a8239b8ebc60f62546d0c
parent64541d6aad210879e104e4796beeef49d4311f6d
libkmod: add a library notice log level print

When you use pass the -v argument to modprobe we bump
the log level from the default modprobe log level of
LOG_WARNING (4) to LOG_NOTICE (5), however the library
only has avaiable to print:

 #define DBG(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg)
 #define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg)
 #define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg)

LOG_INFO (6) however is too high of a level for it to be
effective at printing anything when modprobe -v is passed.
And so the only way in which modprobe -v can trigger the
library to print a verbose message is to use ERR() but that
always prints something and we don't want that in some
situations.

We need to add a new log level macro which uses LOG_NOTICE (5)
for a "normal but significant condition" which users and developers
can use to look underneath the hood to confirm if a situation is
happening.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
libkmod/libkmod-internal.h