From da9d177514fe438edd8262226cdc770df6c9eb82 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 30 Aug 2019 11:40:23 -0400 Subject: Initial check in Initial check in of contents of the original repository: git://github.com/AGLExport/agl-service-navigation as of commit 1f1ffc92fcc882aa5e885badbc91a3384f5d77b1. Bug-AGL: SPEC-2787 Signed-off-by: Scott Murray Change-Id: I02d008ee73cdfd88f1e7587ee57101187b9c4d6d (cherry picked from commit f14ecdd52975ae365af5ed32648bf55dddacb8d9) --- libnavi/include/traces.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 libnavi/include/traces.h (limited to 'libnavi/include/traces.h') diff --git a/libnavi/include/traces.h b/libnavi/include/traces.h new file mode 100644 index 0000000..a1f96ec --- /dev/null +++ b/libnavi/include/traces.h @@ -0,0 +1,38 @@ +// Copyright 2017 AISIN AW CO.,LTD + +#ifndef __TRACE_H__ +#define __TRACE_H__ + +#include + +#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__ -- cgit 1.2.3-korg