summaryrefslogtreecommitdiff
path: root/src/include/mf-ug-dlog.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/mf-ug-dlog.h')
-rw-r--r--src/include/mf-ug-dlog.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/include/mf-ug-dlog.h b/src/include/mf-ug-dlog.h
new file mode 100644
index 0000000..1401063
--- /dev/null
+++ b/src/include/mf-ug-dlog.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.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://floralicense.org/license/
+ *
+ * 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 __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 LOG_COLOR_RED "\033[31m"
+#define LOG_COLOR_RESET "\033[0m"
+
+#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);
+#define ug_error(fmt, arg...) LOGE(LOG_COLOR_RED"[ %s : %d] "fmt""LOG_COLOR_RESET, __FUNCTION__, __LINE__,##arg)
+
+
+#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)
+
+#define MF_CHECK(expr) ug_mf_retm_if(!(expr),"INVALID PARAM RETURN")
+
+#endif