tizen 2.4 release
[apps/home/ug-lockscreen-setting-efl.git] / ug-lockscreen-setting-efl / include / lockscreen-options-debug.h
1 /*
2  * Copyright (c) 2009 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18
19 #ifndef __LOCKSCREEN_OPTIONS_DEBUG_H__
20 #define __LOCKSCREEN_OPTIONS_DEBUG_H__
21
22 #include <stdio.h>
23
24 #define FONT_CLEAR          "\033[0m"
25 #define FONT_COLOR_RED      "\033[31m"
26
27 #define OPENLOCK_USING_PLATFORM_DEBUG
28
29 #ifdef OPENLOCK_USING_PLATFORM_DEBUG
30 #ifndef LOG_TAG
31 #define LOG_TAG "LSO"
32 #endif
33 #include <dlog.h>
34
35 #define LOCKOPTIONS_DBG(fmt, args...)  LOGD("["LOG_TAG"%s:%d:D] "fmt,  __func__, __LINE__, ##args)
36 #define LOCKOPTIONS_WARN(fmt, args...) LOGW("["LOG_TAG"%s:%d:W] "fmt,  __func__, __LINE__, ##args)
37 #define LOCKOPTIONS_ERR(fmt, args...)  LOGE("["LOG_TAG"%s:%d:E] "fmt,  __func__, __LINE__, ##args)
38
39 #else
40 #define LOCKOPTIONS_DBG(fmt, args...) do{printf("[LOCKOPTIONS_DBG][%s(%d)] "fmt " \n", __FILE__, __LINE__, ##args);}while(0);
41 #define LOCKOPTIONS_WARN(fmt, args...) do{printf("[LOCKOPTIONS_WARN][%s(%d)] "fmt " \n", __FILE__, __LINE__, ##args);}while(0);
42 #define LOCKOPTIONS_ERR(fmt, args...) do{printf("[LOCKOPTIONS_ERR][%s(%d)] "fmt " \n", __FILE__, __LINE__, ##args);}while(0);
43 #endif                          /* LOCKD_USING_PLATFORM_DEBUG */
44
45 #define LOCKOPTIONS_TRACE_BEGIN do {\
46                 {\
47                         LOGW("ENTER FUNCTION: %s.\n", __FUNCTION__);\
48                 }\
49         }while(0);
50
51 #define LOCKOPTIONS_TRACE_END do {\
52                 {\
53                         LOGW("EXIT FUNCTION: %s.\n", __FUNCTION__);\
54                 }\
55         }while(0);
56
57 #define ret_if(expr) do { \
58         if(expr) { \
59                 LOCKHELP_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
60                 return; \
61         } \
62 } while (0)
63
64 #ifndef TRUE
65 #define TRUE 1
66 #endif
67 #ifndef FALSE
68 #define FALSE 0
69 #endif
70
71 #endif                          /* __OPENLOCK_SETTING_DEBUG_H__ */