IPANAT: remove the syslog usage
Recently we found in android platform, the syslog
will open lots of sockets and not close them correctly.
Eventually it will exceed the max file descriptor each
process could open, then leading crash. The cahnge is
to avoid using syslog to log message.
Change-Id: Ib7e2a669d1f0f56528d00e2cef9b10e51e04b4b0
diff --git a/ipanat/inc/ipa_nat_logi.h b/ipanat/inc/ipa_nat_logi.h
index 0e1a5d1..5f79cc6 100644
--- a/ipanat/inc/ipa_nat_logi.h
+++ b/ipanat/inc/ipa_nat_logi.h
@@ -50,18 +50,15 @@
#include <string.h>
#include <syslog.h>
-#define PERROR(fmt) printf("%s:%d %s()", __FILE__, __LINE__, __FUNCTION__);\
- perror(fmt);
+#define PERROR(fmt) printf("%s:%d %s()", __FILE__, __LINE__, __FUNCTION__);\
+ perror(fmt);
-#define IPAERR(fmt, ...) syslog(LOG_ERR, "ERROR: %s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\
- printf("ERR: %s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
+#define IPAERR(fmt, ...) printf("ERR: %s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
#ifdef DEBUG
-#define IPADBG(fmt, ...) syslog(LOG_DEBUG, "%s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\
- printf("%s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
+#define IPADBG(fmt, ...) printf("%s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
-#define IPADUMP(fmt, ...) syslog(LOG_DEBUG, fmt, ##__VA_ARGS__);\
- printf(fmt, ##__VA_ARGS__);
+#define IPADUMP(fmt, ...) printf(fmt, ##__VA_ARGS__);
#else
#define IPADBG(fmt, ...)