Refactor, _d() et al to use logit() instead of err.h

This patch is the first in a series of changes to clean up the internal
logging APIs of Finit:

  1. Convert log macros to use logit() for everything (this patch)
  2. Set correct syslog() log level based on debug flag
  3. Do closelog()/openlog() when toggling debug flag to control LOG_PERROR

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-07-01 20:34:37 +02:00
1 parent d1df837d04
commit 5e8cb63f9a
3 files changed
+12 -15

No files matched your search

+2
View File
@@ -21,6 +21,7 @@
* THE SOFTWARE.
*/
#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <lite/lite.h>
@@ -46,6 +47,7 @@ void log_toggle_debug(void)
void logit(int prio, const char *fmt, ...)
{
va_list ap;
static int _slup = 0;
va_start(ap, fmt);
if (!_slup && !fexist("/dev/log")) {