log.c: New log_exit() function, called at shutdown

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-07-02 12:31:38 +02:00
1 parent 8ce330bcdb
commit 1036c365b8
4 files changed
+21 -15

No files matched your search

+13
View File
@@ -22,6 +22,7 @@
*/
#include "config.h"
#include <sched.h> /* sched_yield() */
#include <stdio.h>
#include <stdarg.h>
#include <lite/lite.h>
@@ -31,6 +32,18 @@
static int loglevel = LOG_NOTICE;
/* If we enabled terse mode at boot, restore to previous setting at shutdown */
void log_exit(void)
{
if (quiet) {
silent = SILENT_MODE;
if (!silent) {
sched_yield();
fputs("\n", stderr);
}
}
}
void log_debug(void)
{
debug = !debug;