tizen 2.4 release
[framework/web/wrt-commons.git] / modules / core / src / main.cpp
similarity index 90%
rename from modules_mobile/core/src/main.cpp
rename to modules/core/src/main.cpp
index 1d0326b..0b6b1fc 100644 (file)
@@ -21,7 +21,7 @@
  */
 #include <stddef.h>
 #include <dpl/main.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
 #include <sys/select.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -82,7 +82,7 @@ Main::Main()
 
     // It is impossible that there exist watchers at this time
     // No need to add watchers
-    LogPedantic("ECORE event handler registered");
+    WrtLogD("ECORE event handler registered");
 }
 
 Main::~Main()
@@ -124,7 +124,7 @@ Main::~Main()
 
 Eina_Bool Main::StaticDispatchInvoker(void *data, Ecore_Fd_Handler *fd_handler)
 {
-    LogPedantic("Static ECORE dispatch invoker");
+    WrtLogD("Static ECORE dispatch invoker");
 
     Main *This = static_cast<Main *>(data);
     (void)fd_handler;
@@ -133,7 +133,7 @@ Eina_Bool Main::StaticDispatchInvoker(void *data, Ecore_Fd_Handler *fd_handler)
 
     // Late EFL event handling
     if (g_lateMain == NULL) {
-        LogPedantic("WARNING: Late EFL invoker dispatch!");
+        WrtLogD("WARNING: Late EFL invoker dispatch!");
     } else {
         This->DispatchInvoker();
     }
@@ -144,7 +144,7 @@ Eina_Bool Main::StaticDispatchInvoker(void *data, Ecore_Fd_Handler *fd_handler)
 Eina_Bool Main::StaticDispatchReadWatcher(void* data,
                                           Ecore_Fd_Handler* fd_handler)
 {
-    LogPedantic("Static ECORE dispatch read watcher");
+    WrtLogD("Static ECORE dispatch read watcher");
 
     Main *This = static_cast<Main *>(data);
 
@@ -152,7 +152,7 @@ Eina_Bool Main::StaticDispatchReadWatcher(void* data,
 
     // Late EFL event handling
     if (g_lateMain == NULL) {
-        LogPedantic("WARNING: Late EFL read watcher dispatch!");
+        WrtLogD("WARNING: Late EFL read watcher dispatch!");
     } else {
         This->DispatchReadWatcher(static_cast<WaitableHandle>(
                                       ecore_main_fd_handler_fd_get(fd_handler)));
@@ -164,7 +164,7 @@ Eina_Bool Main::StaticDispatchReadWatcher(void* data,
 Eina_Bool Main::StaticDispatchWriteWatcher(void* data,
                                            Ecore_Fd_Handler* fd_handler)
 {
-    LogPedantic("Static ECORE dispatch write watcher");
+    WrtLogD("Static ECORE dispatch write watcher");
 
     Main *This = static_cast<Main *>(data);
 
@@ -172,7 +172,7 @@ Eina_Bool Main::StaticDispatchWriteWatcher(void* data,
 
     // Late EFL event handling
     if (g_lateMain == NULL) {
-        LogPedantic("WARNING: Late EFL write watcher dispatch!");
+        WrtLogD("WARNING: Late EFL write watcher dispatch!");
     } else {
         This->DispatchWriteWatcher(static_cast<WaitableHandle>(
                                        ecore_main_fd_handler_fd_get(fd_handler)));
@@ -183,7 +183,7 @@ Eina_Bool Main::StaticDispatchWriteWatcher(void* data,
 
 void Main::DispatchInvoker()
 {
-    LogPedantic("Dispatching invoker...");
+    WrtLogD("Dispatching invoker...");
 
     // Reload watch list
     ReloadWatchList();
@@ -191,14 +191,13 @@ void Main::DispatchInvoker()
     // Handle base invoker
     WaitableHandleWatchSupport::InvokerFinished();
 
-    LogPedantic("Invoker dispatched");
+    WrtLogD("Invoker dispatched");
 }
 
 void Main::ReloadWatchList()
 {
-    LogPedantic(
-        "Reloading watch list... (" << m_readWatchersList.size() << " + " <<
-        m_writeWatchersList.size() << ")");
+    WrtLogD("Reloading watch list... (%i + %i)",
+            m_readWatchersList.size(), m_writeWatchersList.size());
 
     // Reload list of watchers
     WaitableHandleListEx waitableWatcherHandles =
@@ -349,29 +348,28 @@ void Main::ReloadWatchList()
         }
     }
 
-    LogPedantic(
-        "Watch list reloaded  (" << m_readWatchersList.size() << " + " <<
-        m_writeWatchersList.size() << ")");
+    WrtLogD("Watch list reloaded  (%i + %i)",
+            m_readWatchersList.size(), m_writeWatchersList.size());
 }
 
 void Main::DispatchReadWatcher(WaitableHandle waitableHandle)
 {
-    LogPedantic("Dispatching read watcher...");
+    WrtLogD("Dispatching read watcher...");
 
     // Handle watcher
     WaitableHandleWatchSupport::HandleWatcher(waitableHandle, WaitMode::Read);
 
-    LogPedantic("Watcher dispatched");
+    WrtLogD("Watcher dispatched");
 }
 
 void Main::DispatchWriteWatcher(WaitableHandle waitableHandle)
 {
-    LogPedantic("Dispatching write watcher...");
+    WrtLogD("Dispatching write watcher...");
 
     // Handle watcher
     WaitableHandleWatchSupport::HandleWatcher(waitableHandle, WaitMode::Write);
 
-    LogPedantic("Watcher dispatched");
+    WrtLogD("Watcher dispatched");
 }
 
 Thread *Main::GetInvokerThread()
@@ -420,23 +418,20 @@ int Main::EcoreSelectInterceptor(int nfds,
                     if (errno == EBADF) {
                         // This a bad descriptor. Remove all occurrences of it.
                         if (FD_ISSET(i, readfds)) {
-                            LogPedantic(
-                                "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad read descriptor: "
-                                << i);
+                            WrtLogD(
+                                "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad read descriptor: %i", i);
                             FD_CLR(i, readfds);
                         }
 
                         if (FD_ISSET(i, writefds)) {
-                            LogPedantic(
-                                "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad write descriptor: "
-                                << i);
+                            WrtLogD(
+                                "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad write descriptor: %i", i);
                             FD_CLR(i, writefds);
                         }
 
                         if (FD_ISSET(i, exceptfds)) {
-                            LogPedantic(
-                                "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad exception descriptor: "
-                                << i);
+                            WrtLogD(
+                                "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad exception descriptor: %i", i);
                             FD_CLR(i, exceptfds);
                         }
                     } else {
@@ -447,8 +442,7 @@ int Main::EcoreSelectInterceptor(int nfds,
             }
         }
 
-        LogPedantic(
-            "GLIB_LOOP_INTEGRATION_WORKAROUND: Bad read descriptor. Retrying with default select.");
+        WrtLogD("GLIB_LOOP_INTEGRATION_WORKAROUND: Bad read descriptor. Retrying with default select.");
 
         //Retry with old values and return new error
         memcpy(readfds, &rfds, sizeof(fd_set));