2 * Copyright (c) 2010 Samsung Electronics, Inc.
5 * This software is a confidential and proprietary information
6 * of Samsung Electronics, Inc. ("Confidential Information"). You
7 * shall not disclose such Confidential Information and shall use
8 * it only in accordance with the terms of the license agreement
9 * you entered into with Samsung Electronics.
11 #ifndef __OICAPP_LOG_H__
12 #define __OICAPP_LOG_H__
14 #define TIZEN_DEBUG_ENABLE
15 #define LOG_TAG "OIC_TEST"
18 #define LOG_COLOR_RED "\033[0;31m"
19 #define LOG_COLOR_BROWN "\033[0;33m"
20 #define LOG_COLOR_BLUE "\033[0;34m"
21 #define LOG_COLOR_END "\033[0;m"
25 #define _DBG(fmt, arg...) SLOGD(fmt, ##arg)
26 #define _INFO(fmt, arg...) SLOGI(fmt, ##arg)
27 #define _WARN(fmt, arg...) SLOGW(fmt, ##arg)
28 #define _ERR(fmt, arg...) SLOGE(fmt, ##arg)
30 #define _DBG(fmt, arg...) \
31 printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
32 #define _INFO(fmt, arg...) \
33 printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
34 #define _WARN(fmt, arg...) \
35 printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
36 #define _ERR(fmt, arg...) \
37 printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
40 #define DBG(fmt, arg...) _DBG(fmt, ##arg)
41 #define WARN(fmt, arg...) _WARN(LOG_COLOR_BROWN fmt LOG_COLOR_END, ##arg)
42 #define ERR(fmt, arg...) _ERR(LOG_COLOR_RED fmt LOG_COLOR_END, ##arg)
43 #define INFO(fmt, arg...) _INFO(LOG_COLOR_BLUE fmt LOG_COLOR_END, ##arg)
45 #define ret_if(expr) \
52 #define retv_if(expr, val) \
59 #define retm_if(expr, fmt, arg...) \
66 #define retvm_if(expr, val, fmt, arg...) \
73 #define warn_if(expr) \
76 WARN("(%s)", #expr); \
81 #endif //__OICAPP_LOG_H__