mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
log.c: Filter debug messages by default, like before refactor
Ways to log: - Set debug, using kernel cmdline, or edit the sources - Change loglevel severity, default blocks > LOG_NOTICE Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -104,17 +104,16 @@ static void early_logit(int prio, const char *fmt, va_list ap)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
if (!debug && prio > loglevel)
|
||||
return;
|
||||
|
||||
fp = fopen("/dev/kmsg", "w");
|
||||
if (fp) {
|
||||
if (debug)
|
||||
prio = LOG_ERR;
|
||||
|
||||
fprintf(fp, "<%d>finit[1]:", LOG_DAEMON | prio);
|
||||
vfprintf(fp, fmt, ap);
|
||||
fclose(fp);
|
||||
} else {
|
||||
if (debug || prio <= LOG_ERR)
|
||||
vfprintf(stderr, fmt, ap);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user