mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Force all log messages to console in --debug mode
As a last ditch effort to understand why an embedded system doesn't boot, the operator should be able to see as much logs as possible when enabling --debug mode on the kernel command line. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -197,12 +197,15 @@ void logit(int prio, const char *fmt, ...)
|
||||
|
||||
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 {
|
||||
fprintf(stderr, "Failed opening /dev/kmsg for appending ...\n");
|
||||
if (prio <= LOG_ERR)
|
||||
if (debug || prio <= LOG_ERR)
|
||||
vfprintf(stderr, fmt, ap);
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
Reference in New Issue
Block a user