summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2014-11-02 16:14:16 +0800
committerArron Wang <arron.wang@intel.com>2014-11-25 16:21:34 +0800
commitb2d951971361e93c8a6ed67d1bb5fda4fae21532 (patch)
tree8d7b1111c1d3d0b0ef7bb926dfabce61ca609088
parent12ab8cdb83253802061bff5a998d27a092f13bbc (diff)
downloadneardal-b2d951971361e93c8a6ed67d1bb5fda4fae21532.tar.gz
neardal-b2d951971361e93c8a6ed67d1bb5fda4fae21532.tar.bz2
neardal-b2d951971361e93c8a6ed67d1bb5fda4fae21532.zip
Enable tizen dlog log system
Change-Id: If46bf22a2bafeb16a8aac92498c8cc1ab10e4409
-rw-r--r--configure.ac6
-rw-r--r--lib/neardal_traces_prv.h13
2 files changed, 13 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 8915850..6d07ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,12 @@ AC_SEARCH_LIBS([rl_initialize], [edit readline],
[CPPFLAGS="-DHAVE_LIBEDIT $CPPFLAGS"])],
[AC_MSG_ERROR(editline or readline is required)])
+PKG_CHECK_MODULES(DLOG, dlog, dummy=yes, AC_MSG_ERROR(dlog is required))
+AC_SUBST(DLOG_CFLAGS)
+AC_SUBST(DLOG_LIBS)
+LDFLAGS="$LDFLAGS -ldlog"
+CFLAGS="$CFLAGS -I/usr/include/dlog"
+
AC_PATH_TOOL([DOXYGEN], [doxygen])
AM_CONDITIONAL([HAVE_DOXYGEN], [test ! -z "$DOXYGEN"])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doxygen.cfg])])
diff --git a/lib/neardal_traces_prv.h b/lib/neardal_traces_prv.h
index cd44570..9e9088e 100644
--- a/lib/neardal_traces_prv.h
+++ b/lib/neardal_traces_prv.h
@@ -21,6 +21,8 @@
#ifndef NEARDAL_TRACES_PRV_H
#define NEARDAL_TRACES_PRV_H
+#include <dlog.h>
+
/* a debug output macro */
#ifdef NEARDAL_TRACES
#define NEARDAL_TRACE(...) neardal_trace(NULL, stdout, __VA_ARGS__)
@@ -32,15 +34,14 @@
#define NEARDAL_TRACEIN() neardal_trace(__func__, stdout, \
"Processing...\n")
#else
- #define NEARDAL_TRACE(...)
+ #define NEARDAL_TRACE(format, arg...) (LOG_ON() ? (LOG(LOG_DEBUG, "NEARDAL", "%s:%s(%d)>" format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
+ #define NEARDAL_TRACEF(format, arg...) (LOG_ON() ? (LOG(LOG_DEBUG, "NEARDAL", "%s:%s(%d)>" format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
+ #define NEARDAL_TRACEIN(format, arg...) (LOG_ON() ? (LOG(LOG_DEBUG, "NEARDAL", "%s:%s(%d)>" format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
#define NEARDAL_TRACEDUMP(...)
- #define NEARDAL_TRACEF(...)
- #define NEARDAL_TRACEIN(...)
#endif /* NEARDAL_DEBUG */
/* always defined */
-#define NEARDAL_TRACE_LOG(...) neardal_trace(__func__, stdout, __VA_ARGS__)
-#define NEARDAL_TRACE_ERR(...) neardal_trace(__func__, stderr, \
- "Error: " __VA_ARGS__)
+#define NEARDAL_TRACE_LOG(format, arg...) (LOG_ON() ? (LOG(LOG_DEBUG, "NEARDAL", "%s:%s(%d)>" format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
+#define NEARDAL_TRACE_ERR(format, arg...) (LOG_ON() ? (LOG(LOG_DEBUG, "NEARDAL", "%s:%s(%d)>" format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
void neardal_trace(const char *func, FILE *stream, char *format, ...)
__attribute__((format(printf, 3, 4)));