resource: Disable logging if not enabled
[platform/upstream/iotivity.git] / resource / src / OCApi.cpp
index 529573f..bc5c969 100644 (file)
@@ -28,7 +28,12 @@ namespace OC
 {
     std::ostream& oclog()
     {
+#ifdef TB_LOG
         return std::cout;
+#else
+        static std::ostream nullstream(0);
+        return nullstream;
+#endif
     }
 }
 #endif