One shouldn't need debug messages only to have the priority (emergency,
error, warning ...) properly logged.
With this the libkmod logger aligns with the custom one we use for kmod
tools. The latter was printing the priority since day one.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/173
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
va_list args)
{
FILE *fp = data;
-#ifdef ENABLE_DEBUG
char buf[16];
const char *priname;
switch (priority) {
snprintf(buf, sizeof(buf), "L:%d", priority);
priname = buf;
}
+#ifdef ENABLE_DEBUG
fprintf(fp, "libkmod: %s %s:%d %s: ", priname, file, line, fn);
#else
- fprintf(fp, "libkmod: %s: ", fn);
+ fprintf(fp, "libkmod: %s: %s: ", priname, fn);
#endif
vfprintf(fp, format, args);
}