mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
Refactor, move debug toggle to log.c:log_toggle_debug()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
670f08ce51
commit
d1df837d04
3 files changed
+13
-6
No files matched your search
@@ -36,6 +36,7 @@
|
|||||||
#include "cond.h"
|
#include "cond.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
#include "log.h"
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "sig.h"
|
#include "sig.h"
|
||||||
#include "service.h"
|
#include "service.h"
|
||||||
@@ -227,12 +228,7 @@ static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events))
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case INIT_CMD_DEBUG:
|
case INIT_CMD_DEBUG:
|
||||||
debug = !debug;
|
log_toggle_debug();
|
||||||
if (debug)
|
|
||||||
silent = 0;
|
|
||||||
else
|
|
||||||
silent = quiet ? 1 : SILENT_MODE;
|
|
||||||
logit(LOG_INFO, "Debug mode %s", debug ? "enabled" : "disabled");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INIT_CMD_RELOAD: /* 'init q' and 'initctl reload' */
|
case INIT_CMD_RELOAD: /* 'init q' and 'initctl reload' */
|
||||||
|
|||||||
@@ -29,6 +29,16 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
void log_toggle_debug(void)
|
||||||
|
{
|
||||||
|
debug = !debug;
|
||||||
|
if (debug)
|
||||||
|
silent = 0;
|
||||||
|
else
|
||||||
|
silent = quiet ? 1 : SILENT_MODE;
|
||||||
|
logit(LOG_INFO, "Debug mode %s", debug ? "enabled" : "disabled");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Log to /dev/kmsg until syslogd has started, then openlog()
|
* Log to /dev/kmsg until syslogd has started, then openlog()
|
||||||
* and continue logging as a regular daemon.
|
* and continue logging as a regular daemon.
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
extern int _slup; /* INTERNAL: Is syslog up yet? */
|
extern int _slup; /* INTERNAL: Is syslog up yet? */
|
||||||
|
|
||||||
|
void log_toggle_debug(void);
|
||||||
void logit (int prio, const char *fmt, ...);
|
void logit (int prio, const char *fmt, ...);
|
||||||
|
|
||||||
#endif /* FINIT_LOG_H_ */
|
#endif /* FINIT_LOG_H_ */
|
||||||
Reference in new issue
Block a user