tizen 2.4 release
[framework/web/wrt-commons.git] / modules / core / src / assert.cpp
old mode 100755 (executable)
new mode 100644 (file)
similarity index 58%
rename from modules_wearable/core/src/assert.cpp
rename to modules/core/src/assert.cpp
index 5a18977..76a13ef
  * @brief       This file is the implementation file of assert
  */
 #include <stdio.h>
+#include <cstdlib>
+#include <sstream>
 #include <stddef.h>
 #include <dpl/assert.h>
 #include <dpl/colors.h>
-#include <dpl/log/log.h>
-#include <cstdlib>
+#include <dpl/exception.h>
+#include <dpl/log/wrt_log.h>
 
 namespace DPL {
 void AssertProc(const char *condition,
@@ -32,32 +34,24 @@ void AssertProc(const char *condition,
                 int line,
                 const char *function)
 {
-#define INTERNAL_LOG(message)                                          \
-    do                                                                 \
-    {                                                                  \
-        std::ostringstream platformLog;                                \
-        platformLog << message;                                        \
-        DPL::Log::LogSystemSingleton::Instance().Pedantic(             \
-            platformLog.str().c_str(),                                 \
-            __FILE__, __LINE__, __FUNCTION__);                         \
-    } \
-    while (0)
+
+#define INTERNAL_LOG(message)                  \
+do {                                           \
+        std::ostringstream platformLog;        \
+        platformLog << message;                \
+    WrtLogE("%s", platformLog.str().c_str());  \
+} while (0)
 
     // Try to log failed assertion to log system
-    Try
-    {
-        INTERNAL_LOG(
-            "################################################################################");
-        INTERNAL_LOG(
-            "###                          DPL assertion failed!                           ###");
-        INTERNAL_LOG(
-            "################################################################################");
+    Try {
+        INTERNAL_LOG("########################################################################");
+        INTERNAL_LOG("###                      DPL assertion failed!                       ###");
+        INTERNAL_LOG("########################################################################");
         INTERNAL_LOG("### Condition: " << condition);
         INTERNAL_LOG("### File: " << file);
         INTERNAL_LOG("### Line: " << line);
         INTERNAL_LOG("### Function: " << function);
-        INTERNAL_LOG(
-            "################################################################################");
+        INTERNAL_LOG("########################################################################");
     } catch (Exception) {
         // Just ignore possible double errors
     }