summaryrefslogtreecommitdiff
path: root/src/include/mf-ug-dlog.h
blob: e4b75a138a45fe0d956838470180b2d6329e00a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
 *
 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * This file is part of ug-myfile-efl
 * Written by Guangliang Wang <gliang.wang@samsung.com>
 *
 * PROPRIETARY/CONFIDENTIAL
 *
 * This software is the confidential and proprietary information of
 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered
 * into with SAMSUNG ELECTRONICS.
 *
 * SAMSUNG make no representations or warranties about the suitability
 * of the software, either express or implied, including but not limited
 * to the implied warranties of merchantability, fitness for a particular
 * purpose, or non-infringement. SAMSUNG shall not be liable for any
 * damages suffered by licensee as a result of using, modifying or
 * distributing this software or its derivatives.
 *
 */




#ifndef __DEF_MF_UG_DLOG_H_
#define __DEF_MF_UG_DLOG_H_

#include <stdio.h>
#include <string.h>

#define DLOG_ON 1

#ifdef LOG_TAG
#undef LOG_TAG
#endif

#define LOG_TAG			"MYFILE-UG"
#include <dlog.h>


#if DLOG_ON
#define ug_debug(fmt , args...)        LOGD("[%s][%d]debug message from ug-myfile-efl is : "fmt"\n", __func__, __LINE__, ##args)
#define ug_myfile_dlog(fmt , args...)        LOGD("[%s][%d]debug message from myfile is : "fmt"\n", __func__, __LINE__, ##args)
#define UG_TRACE_BEGIN do {\
		{\
			LOGD("\n\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
			__FUNCTION__, (char *)(strrchr(__FILE__, '/') + 1), __LINE__);\
		} \
	} while (0);

#define UG_TRACE_END  do {\
		{\
			LOGD("\n\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
			__FUNCTION__, (char *)(strrchr(__FILE__, '/') + 1), __LINE__);\
		} \
	} while (0);

#else
#define ug_myfile_dlog(fmt , args...)        printf("[MYFILE][%40s:%4d] "fmt"\n", __func__, __LINE__, ##args)
#endif
#define ug_mf_debug(fmt , args...)			do { (void)0; } while (0)
#define ug_mf_warnig(fmt , args...)			do { (void)0; } while (0)
#define ug_mf_error(fmt , args...)			do { (void)0; } while (0)
#define UG_MYFILE_TRACE_ERROR(fmt, arg...)		do { LOGE("[%s][%d] "fmt"\n", strrchr(__FILE__, '/') + 1, __LINE__, ##arg); } while (0)

#define ug_mf_retvm_if(expr, val, fmt, arg...) do { \
			if (expr) { \
				UG_MYFILE_TRACE_ERROR(fmt, ##arg); \
				return (val); \
			} \
		} while (0)

#define ug_mf_retv_if(expr, val) do { \
			if (expr) { \
				return (val); \
			} \
		} while (0)


#define ug_mf_retm_if(expr, fmt, arg...) do { \
			if (expr) { \
				UG_MYFILE_TRACE_ERROR(fmt, ##arg); \
				return; \
			} \
		} while (0)


#endif