summaryrefslogtreecommitdiff
path: root/include/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/debug.h')
-rw-r--r--include/debug.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/debug.h b/include/debug.h
new file mode 100644
index 0000000..02fecf2
--- /dev/null
+++ b/include/debug.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (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.
+ */
+
+#if !defined(FLOG)
+
+#if defined(SECURE_LOGD)
+#define DbgPrint(format, arg...) SECURE_LOGD(format, ##arg)
+#else
+#define DbgPrint(format, arg...) LOGD(format, ##arg)
+#endif
+
+#if defined(SECURE_LOGD)
+#define ErrPrint(format, arg...) SECURE_LOGE(format, ##arg)
+#else
+#define ErrPrint(format, arg...) LOGE(format, ##arg)
+#endif
+
+#else
+extern FILE *__file_log_fp;
+#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [%s/%s:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+
+#define ErrPrint(format, arg...) do { fprintf(__file_log_fp, "[ERR] [%s/%s:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+#endif
+
+#define EAPI __attribute__((visibility("default")))
+/* End of a file */