Add group_feature_all_page_back
[profile/mobile/apps/native/homescreen-efl.git] / inc / app_log.h
1 #ifndef __APP_LOG_H__
2 #define __APP_LOG_H__
3
4 #include <dlog.h>
5
6 #include "test.h"
7
8 #ifndef  LOG_TAG
9 #define LOG_TAG "HOMESCREEN_EFL"
10 #endif
11
12 #ifndef __MODULE__
13 #define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
14 #endif
15
16 #define LOG_(prio, tag, fmt, arg...) ({ dlog_print(prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); })
17
18 #if (TEST_MODE == TEST_UNIT)
19 #include "../test/unit/inc/unit.h"
20 #define TEST_APP_LOG_TAG "TEST_APP"
21 #define TEST_UNIT_LOG_TAG "TEST_UNIT"
22 #define __D(format, arg...) LOG_(DLOG_DEBUG, LOG_TAG, format, ##arg)
23 #define __I(format, arg...) LOG_(DLOG_INFO, LOG_TAG, format, ##arg)
24 #define __E(format, arg...) LOG_(DLOG_ERROR, LOG_TAG, format, ##arg)
25 #define __T(format, arg...) ({ dlog_print(DLOG_DEBUG, TEST_APP_LOG_TAG, format, ##arg); unit_write_log(format, ##arg); })
26 #define __TU(format, arg...) LOG_(DLOG_DEBUG, TEST_UNIT_LOG_TAG, format, ##arg)
27 #elif (TEST_MODE == TEST_APP)
28 #include "../test/unit/inc/unit.h"
29 #define TEST_APP_LOG_TAG "TEST_APP"
30 #define __D(format, arg...) ({ dlog_print(DLOG_DEBUG, LOG_TAG, format, ##arg); unit_write_log(format, ##arg); })
31 #define __I(format, arg...) LOG_(DLOG_INFO, LOG_TAG, format, ##arg)
32 #define __E(format, arg...) LOG_(DLOG_ERROR, LOG_TAG, format, ##arg)
33 #define __T(format, arg...) LOG_(DLOG_DEBUG, TEST_APP_LOG_TAG, format, ##arg)
34 #else
35 #define __D(format, arg...) LOG_(DLOG_DEBUG, LOG_TAG, format, ##arg)
36 #define __I(format, arg...) LOG_(DLOG_INFO, LOG_TAG, format, ##arg)
37 #define __E(format, arg...) LOG_(DLOG_ERROR, LOG_TAG, format, ##arg)
38 #endif
39
40 #endif