Convert log calls to ulog() api
[project/procd.git] / log.h
diff --git a/log.h b/log.h
index 968c136..bf86f1e 100644 (file)
--- a/log.h
+++ b/log.h
 #ifndef __LOG_H
 #define __LOG_H
 
-#include <syslog.h>
+#include <libubox/ulog.h>
 
 #define DEBUG(level, fmt, ...) do { \
        if (debug >= level) { \
-               syslog(0, fmt, ## __VA_ARGS__); \
-               fprintf(stderr, "procd: %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
+               ulog(LOG_DEBUG, fmt, ## __VA_ARGS__); \
        } } while (0)
 
-#define LOG(fmt, ...) do { \
-               syslog(0, fmt, ## __VA_ARGS__); \
-               fprintf(stderr, "procd: "fmt, ## __VA_ARGS__); \
-       } while (0)
-
-#define ERROR(fmt, ...) do { \
-               syslog(0, fmt, ## __VA_ARGS__); \
-               fprintf(stderr, "procd: "fmt, ## __VA_ARGS__); \
-       } while (0)
+#define LOG   ULOG_INFO
+#define ERROR ULOG_ERR
 
 extern unsigned int debug;