Use dlog instead of eina_log
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 12 Mar 2015 10:32:11 +0000 (11:32 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 18 Mar 2015 14:57:03 +0000 (15:57 +0100)
Change-Id: I31cffc2dc2da6fc2bcad9ff4ef8bed8cfce5fad8

include/common_helpers.h [deleted file]
include/dbg.h [deleted file]
include/etest.h [deleted file]
include/logger.h
src/logger.c [deleted file]
src/main.c
src/screen_reader_spi.c
src/screen_reader_tts.c
src/smart_notification.c
tests/CMakeLists.txt

diff --git a/include/common_helpers.h b/include/common_helpers.h
deleted file mode 100644 (file)
index a34ccf1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * common_helpers.h
- *
- *  Created on: Feb 19, 2014
- *      Author: m.skorupinsk
- */
-
-#ifndef COMMON_HELPERS_H_
-#define COMMON_HELPERS_H_
-
-#include <dlog.h>
-
-#ifdef DEBUG
-       #define PLOG(fmt, ...) \
-               fprintf(stderr, "<D> %s(%d) --> ", __FUNCTION__, __LINE__); \
-               fprintf(stderr, fmt, ##__VA_ARGS__);\
-               fprintf(stderr, "\n");\
-               LOGD(fmt, ##__VA_ARGS__);
-
-       #define PLOGD(fmt, ...) \
-               PLOG(fmt, ##__VA_ARGS__)
-
-       #define PLOGW(fmt, ...) \
-               fprintf(stderr, "<W> %s(%d) --> ", __FUNCTION__, __LINE__); \
-               fprintf(stderr, fmt, ##__VA_ARGS__);\
-               fprintf(stderr, "\n");\
-               LOGD(fmt, ##__VA_ARGS__);
-
-       #define PLOGE(fmt, ...) \
-               fprintf(stderr, "<E> %s(%d) --> ", __FUNCTION__, __LINE__); \
-               fprintf(stderr, fmt, ##__VA_ARGS__);\
-               fprintf(stderr, "\n");\
-               LOGD(fmt, ##__VA_ARGS__);
-
-       #define PLOGI(fmt, ...) \
-               fprintf(stderr, "<I> %s(%d) --> ", __FUNCTION__, __LINE__); \
-               fprintf(stderr, fmt, ##__VA_ARGS__);\
-               fprintf(stderr, "\n");\
-               LOGD(fmt, ##__VA_ARGS__);
-
-#else
-
-       #define PLOG(fmt, ...) \
-               LOGD(fmt, ##__VA_ARGS__);
-
-       #define PLOGD(fmt, ...) \
-               PLOG(fmt, ##__VA_ARGS__);
-
-       #define PLOGW(fmt, ...) \
-               LOGW(fmt, ##__VA_ARGS__);
-
-       #define PLOGE(fmt, ...) \
-               LOGE(fmt, ##__VA_ARGS__);
-
-       #define PLOGI(fmt, ...) \
-               LOGI(fmt, ##__VA_ARGS__);\
-
-#endif
-
-#endif /* COMMON_HELPERS_H_ */
diff --git a/include/dbg.h b/include/dbg.h
deleted file mode 100644 (file)
index fa50e0b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __DBG_H__
-
-#include <dlog.h>
-
-#ifdef  LOG_TAG
-#undef  LOG_TAG
-#endif
-#define LOG_TAG "org.tizen.clientDBusWrapper"
-
-#ifndef _ERR
-#define _ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
-#endif
-
-#ifndef _DBG
-#define _DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
-#endif
-
-#ifndef _INFO
-#define _INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
-#endif
-
-
-#endif /* __DBG_H__ */
diff --git a/include/etest.h b/include/etest.h
deleted file mode 100755 (executable)
index 4b1656e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ETEST_H__
-#define __ETEST_H__
-
-#include <Elementary.h>
-#include <Ecore_X.h>
-#include <Elementary.h>
-#include <Evas.h>
-
-struct appdata {
-       Evas_Object *win;
-};
-
-#endif 
\ No newline at end of file
index b0fdbc0..4886f19 100644 (file)
@@ -1,18 +1,39 @@
-#ifndef LOGGER_H_
-#define LOGGER_H_
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
-#include <eina_log.h>
+#ifndef _LOGGER_H_
 
-extern int _eina_log_dom;
+#include <dlog.h>
 
-int logger_init(void);
-void logger_shutdown(void);
+#ifdef  LOG_TAG
+#undef  LOG_TAG
+#endif
+#define LOG_TAG "SmartNavigator"
 
-#define INFO(...) EINA_LOG_DOM_INFO(_eina_log_dom, __VA_ARGS__);
-#define DEBUG(...) EINA_LOG_DOM_DBG(_eina_log_dom, __VA_ARGS__);
-#define ERROR(...) EINA_LOG_DOM_ERR(_eina_log_dom, __VA_ARGS__);
-#define WARNING(...) EINA_LOG_DOM_WRN(_eina_log_dom, __VA_ARGS__);
+#ifndef ERROR
+#define ERROR(fmt, arg...) LOGE("[%s:%d]:" fmt, __FILE__, __LINE__, ##arg)
+#endif
 
-#define MEMORY_ERROR "Memory allocation error"
+#ifndef DEBUG
+#define DEBUG(fmt, arg...) LOGD("[%s:%d]:" fmt, __FILE__, __LINE__, ##arg)
+#endif
 
-#endif /* end of include guard: LOGGER_H_ */
+#ifndef INFO
+#define INFO(fmt, arg...) LOGI("[%s:%d]:" fmt, __FILE__, __LINE__, ##arg)
+#endif
+
+
+#endif /* _LOGGER_H_ */
diff --git a/src/logger.c b/src/logger.c
deleted file mode 100644 (file)
index 558b274..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "logger.h"
-
-int _eina_log_dom;
-
-int logger_init(void)
-{
-   if (!_eina_log_dom)
-     {
-        _eina_log_dom = eina_log_domain_register("smart-navigator", NULL);
-        if (_eina_log_dom  < 0)
-          {
-             fprintf(stderr, "Unable to register smart-navogator log domain");
-             return -1;
-          }
-     }
-   return 0;
-}
-
-void logger_shutdown(void)
-{
-   if (_eina_log_dom)
-     {
-        eina_log_domain_unregister(_eina_log_dom);
-        _eina_log_dom = 0;
-     }
-}
-
index 2001f28..618fcc6 100755 (executable)
@@ -16,7 +16,6 @@ static bool app_create(void *data)
 {
     atspi_init();
     elm_init(0, NULL);
-    logger_init();
     navigator_init();
     screen_reader_create_service(data);
 
@@ -27,16 +26,12 @@ static void app_terminate(void *data)
 {
     screen_reader_terminate_service(data);
     navigator_shutdown();
-    logger_shutdown();
 }
 
 int main(int argc, char **argv)
 {
-    printf("Application Main Function \n");
     app_create(get_pointer_to_service_data_struct());
-
     elm_run();
-
     app_terminate(get_pointer_to_service_data_struct());
 
     return 0;
index 852e544..ddc8852 100644 (file)
@@ -15,6 +15,7 @@
     #include "test_suite/test_suite.h"
 #endif
 
+#define MEMORY_ERROR "Memory allocation failed"
 #define NO_VALUE_INTERFACE "No value interface present"
 #define NO_TEXT_INTERFACE "No text interface present"
 
@@ -326,7 +327,7 @@ void spi_init(Service_Data *sd)
     sd->spi_listener = atspi_event_listener_new(spi_event_listener_cb, service_data, NULL);
     if(sd->spi_listener == NULL)
       {
-         DEBUG("FAILED TO CREATE spi state changed listener")
+         DEBUG("FAILED TO CREATE spi state changed listener");
       }
 
     // ---------------------------------------------------------------------------------------------------
index 62bba94..5c1d0b2 100644 (file)
@@ -9,6 +9,7 @@
 #include <Ecore.h>
 #include "screen_reader_tts.h"
 #include "logger.h"
+#define MEMORY_ERROR "Memory allocation failed"
 
 // ---------------------------- DEBUG HELPERS ------------------------------
 
@@ -213,7 +214,7 @@ Eina_Bool update_supported_voices(void *data)
          sd->update_language_list = EINA_TRUE;
       }
 
-    DEBUG("END")
+    DEBUG("END");
     return EINA_TRUE;
 }
 
index dcbc751..8387298 100644 (file)
@@ -97,8 +97,8 @@ _scroll_event_cb(AtspiEvent     *event, void *user_data)
    start_index = 0;
    end_index = 0;
 
-   fprintf(stderr, "Event: %s: %d, obj: %p: role: %s\n", event->type, event->detail1, event->source,
-           atspi_accessible_get_role_name(event->source, NULL));
+   DEBUG("Event: %s: %d, obj: %p: role: %s\n", event->type, event->detail1, event->source,
+         atspi_accessible_get_role_name(event->source, NULL));
 
    if (!strcmp(event->type, "object:scroll-start"))
      {
index f1e0859..89de7eb 100644 (file)
@@ -35,7 +35,6 @@ SET(TESTED_SRCS ${CMAKE_SOURCE_DIR}/src/screen_reader.c
                 ${CMAKE_SOURCE_DIR}/src/screen_reader_vconf.c
                 ${CMAKE_SOURCE_DIR}/src/screen_reader_spi.c
                 ${CMAKE_SOURCE_DIR}/src/screen_reader_tts.c
-                ${CMAKE_SOURCE_DIR}/src/logger.c
                 ${CMAKE_SOURCE_DIR}/src/flat_navi.c
                 ${CMAKE_SOURCE_DIR}/src/position_sort.c
                 ${CMAKE_SOURCE_DIR}/src/object_cache.c)