Added DEBUG_LOG_STREAM for using stream operator 57/181557/2
authorDavid Steele <david.steele@samsung.com>
Thu, 14 Jun 2018 16:54:43 +0000 (17:54 +0100)
committerDavid Steele <david.steele@samsung.com>
Thu, 14 Jun 2018 18:57:11 +0000 (19:57 +0100)
Change-Id: I7864dd73c6b313b41b9b9ba7aab20e94cb262d55

dali/integration-api/debug.h

index ad0abd4..309649b 100644 (file)
 // EXTERNAL INCLUDES
 #include <string>
 #include <sstream>
+#include <iostream>
 #include <list>
 #include <stdint.h>
+
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/property-map.h>
 
@@ -312,9 +314,18 @@ public:
 #define DALI_LOG_INFO(filter, level, format, args...)                        \
   if(filter && filter->IsEnabledFor(level)) { filter->Log(level, format,  ## args); }
 
+#define DALI_LOG_STREAM( filter, level, stream )  \
+  if(filter && filter->IsEnabledFor(level))       \
+  {                                               \
+    std::ostringstream o;                         \
+    o << stream << std::endl;                     \
+    filter->Log(level, "%s", o.str().c_str());    \
+  }
+
 #else // DEBUG_ENABLED
 
 #define DALI_LOG_INFO(filter, level, format, args...)
+#define DALI_LOG_STREAM( filter, level, stream )
 
 #endif // DEBUG_ENABLED