summaryrefslogtreecommitdiffstats
path: root/traces.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-08-30 11:43:58 -0400
committerScott Murray <scott.murray@konsulko.com>2019-08-30 11:45:55 -0400
commitededa7e3ef24a8cea9e513fa008ef481c1675457 (patch)
tree86a4c79d066b9638b11c0f127ad8f3c66c38c4f7 /traces.h
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
Initial check in
Initial check in of the original repository: git://github.com/AGLExport/genivi-navi-yelp-client.git as of commit c2691cb265d9198542482a860f1df378e8c2708b. Bug-AGL: SPEC-2787 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I7405367387622fb788a5712ed24005ee6d7ce495
Diffstat (limited to 'traces.h')
-rw-r--r--traces.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/traces.h b/traces.h
new file mode 100644
index 0000000..6f2cf3a
--- /dev/null
+++ b/traces.h
@@ -0,0 +1,36 @@
+#ifndef __TRACE_H__
+#define __TRACE_H__
+
+#include <stdio.h>
+
+#define BLACK "\033[30m"
+#define RED "\033[31m"
+#define GREEN "\033[32m"
+#define YELLOW "\033[33m"
+#define BLUE "\033[34m"
+#define PURPLE "\033[35m"
+#define DGREEN "\033[6m"
+#define WHITE "\033[7m"
+#define CYAN "\x1b[36m"
+#define NONE "\033[0m"
+
+#ifdef NDEBUG
+
+#define TRACE_DEBUG_JSON(fmt, args...)
+#define TRACE_DEBUG(fmt, args...)
+#define TRACE_INFO(fmt, args...)
+#define TRACE_WARN(fmt, args...)
+#define TRACE_ERROR(fmt, args...)
+
+#else
+
+#define TRACE_DEBUG(fmt, args...) do { fprintf(stderr, "[%s:%d] " CYAN "DEBUG" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0)
+#define TRACE_INFO(fmt, args...) do { fprintf(stderr, "[%s:%d] " GREEN "INFO" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0)
+#define TRACE_WARN(fmt, args...) do { fprintf(stderr, "[%s:%d] " YELLOW "WARN" NONE": " fmt "\n", __func__, __LINE__, ##args); } while(0)
+#define TRACE_ERROR(fmt, args...) do { fprintf(stderr, "[%s:%d] " RED "ERROR" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0)
+
+#define TRACE_DEBUG_JSON(fmt, args...)
+
+#endif
+
+#endif // __TRACE_H__