diff options
author | Scott Murray <scott.murray@konsulko.com> | 2019-08-30 11:40:23 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2019-09-05 00:18:27 +0000 |
commit | da9d177514fe438edd8262226cdc770df6c9eb82 (patch) | |
tree | e33d2af8d2e129b372caf34afac37366b641553a /src/traces.h | |
parent | dd61aa309b3a082488c9d3c383c1601fd3efbc2a (diff) |
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 <scott.murray@konsulko.com>
Change-Id: I02d008ee73cdfd88f1e7587ee57101187b9c4d6d
(cherry picked from commit f14ecdd52975ae365af5ed32648bf55dddacb8d9)
Diffstat (limited to 'src/traces.h')
-rw-r--r-- | src/traces.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/traces.h b/src/traces.h new file mode 100644 index 0000000..a1f96ec --- /dev/null +++ b/src/traces.h @@ -0,0 +1,38 @@ +// Copyright 2017 AISIN AW CO.,LTD + +#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__ |