You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/12/07 04:46:36 UTC

[02/10] incubator-mynewt-core git commit: oic; add debug log macro.

oic; add debug log macro.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/57df8376
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/57df8376
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/57df8376

Branch: refs/heads/develop
Commit: 57df8376decc113edf1f3a0ca057417c6a8069f1
Parents: 2822a9c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Dec 6 20:36:14 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Dec 6 20:45:59 2016 -0800

----------------------------------------------------------------------
 net/oic/include/oic/oc_log.h | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/57df8376/net/oic/include/oic/oc_log.h
----------------------------------------------------------------------
diff --git a/net/oic/include/oic/oc_log.h b/net/oic/include/oic/oc_log.h
index e77575b..547f452 100644
--- a/net/oic/include/oic/oc_log.h
+++ b/net/oic/include/oic/oc_log.h
@@ -18,12 +18,13 @@
 #define OC_LOG_H
 
 #include <stdio.h>
-#include "mynewt/config.h"
+#include <log/log.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+
 #define PRINT(...) printf(__VA_ARGS__)
 
 #define PRINTipaddr(endpoint)                                                  \
@@ -58,22 +59,11 @@ extern "C" {
     LOG_INFO(&oc_log, LOG_MODULE_IOTIVITY, "%s", tmp_buf);                     \
 }
 
-#if defined(ARCH_sim)
-#define LOG(...) PRINT(__VA_ARGS__)
-#define ERROR(...) LOG(__VA_ARGS__)
-#define LOGipaddr(endpoint) PRINTipaddr(endpoint)
-#define oc_log_init()   0
-#elif defined(DEBUG)
-int oc_log_init(void);
+extern struct log oc_log;
+#define OC_LOG_DEBUG(...) LOG_DEBUG(&oc_log, LOG_MODULE_IOTIVITY,__VA_ARGS__)
 #define LOG(...) LOG_INFO(&oc_log, LOG_MODULE_IOTIVITY,__VA_ARGS__)
 #define ERROR(...) LOG_ERROR(&oc_log, LOG_MODULE_IOTIVITY,__VA_ARGS__)
 #define LOGipaddr(endpoint) LogMynewtipaddr(endpoint)
-#else
-#define LOG(...)
-#define ERROR(...)
-#define LOGipaddr(endpoint)
-#define oc_log_init()   0
-#endif
 
 #ifdef __cplusplus
 }