10#ifndef BGT60_LOGGER_HPP_
11#define BGT60_LOGGER_HPP_
15#if (BGT60_LOGGER_ENABLED == 1)
30 Logger(LoggerPAL *logpal);
34 void print(
const char * format, ...);
35 void printfModule(
const char * format,
const char *module,
const char * color, ...);
36 void printModuleHex(
const uint8_t * array, uint32_t length,
const char * module,
const char * color);
47extern Logger bgt60_log;
52#define BGT60_LOGGER_COLOR_RED "\x1b[31m"
53#define BGT60_LOGGER_COLOR_GREEN "\x1b[32m"
54#define BGT60_LOGGER_COLOR_YELLOW "\x1b[33m"
55#define BGT60_LOGGER_COLOR_BLUE "\x1b[34m"
56#define BGT60_LOGGER_COLOR_MAGENTA "\x1b[35m"
57#define BGT60_LOGGER_COLOR_CYAN "\x1b[36m"
58#define BGT60_LOGGER_COLOR_LIGHT_GREY "\x1b[90m"
59#define BGT60_LOGGER_COLOR_LIGHT_RED "\x1b[91m"
60#define BGT60_LOGGER_COLOR_LIGHT_GREEN "\x1b[92m"
61#define BGT60_LOGGER_COLOR_LIGHT_YELLOW "\x1b[93m"
62#define BGT60_LOGGER_COLOR_LIGHT_BLUE "\x1b[94m"
63#define BGT60_LOGGER_COLOR_LIGHT_MAGENTA "\x1b[95m"
64#define BGT60_LOGGER_COLOR_LIGHT_CYAN "\x1b[96m"
65#define BGT60_LOGGER_COLOR_DEFAULT "\x1b[0m"
74#define BGT60_LOGGER_ERROR_COLOR BGT60_LOGGER_COLOR_RED
75#define BGT60_LOGGER_WARNING_COLOR BGT60_LOGGER_COLOR_YELLOW
77#define BGT60_LOG_INIT()\
82#define BGT60_LOG_DEINIT()\
90#if (BGT60_CORE_LOGGER_ENABLED == 1)
92#define BGT60_LOGGER_SERVICE "[bgt60] : "
93#define BGT60_LOGGER_COLOR BGT60_LOGGER_COLOR_GREEN
95#define BGT60_LOG_MSG(str)\
97bgt60_log.printfModule(str, BGT60_LOGGER_SERVICE, BGT60_LOGGER_COLOR);\
100#define BGT60_LOG_RETURN(ret)\
104 bgt60_log.printfModule("fail with return code %i", BGT60_LOGGER_SERVICE, BGT60_LOGGER_ERROR_COLOR, ret);\
108 bgt60_log.printfModule("pass", BGT60_LOGGER_SERVICE, BGT60_LOGGER_COLOR);\
114#define BGT60_LOG_MSG(str) { }
115#define BGT60_LOG_RETURN(ret) { }
122#if (BGT60_APP_LOGGER_ENABLED == 1)
127#define BGT60_APP_LOGGER_ERROR_COLOR BGT60_LOGGER_COLOR_RED
128#define BGT60_APP_LOGGER_WARNING_COLOR BGT60_LOGGER_COLOR_LIGHT_YELLOW
130#define BGT60_APP_LOGGER_SERVICE "[bgt60 app] : "
131#define BGT60_APP_LOGGER_COLOR BGT60_LOGGER_COLOR_MAGENTA
133#define BGT60_APP_LOG_MSG(str)\
135 bgt60_log.printfModule(str, BGT60_APP_LOGGER_SERVICE, BGT60_APP_LOGGER_COLOR);\
138#define BGT60_APP_LOG_VAR(str, var)\
140 bgt60_log.printfModule(str, BGT60_APP_LOGGER_SERVICE, BGT60_APP_LOGGER_COLOR, var);\
143#define BGT60_APP_LOG_RETURN(ret)\
147 bgt60_log.printfModule("fail with return code %i", BGT60_APP_LOGGER_SERVICE, BGT60_APP_LOGGER_ERROR_COLOR, ret);\
151 bgt60_log.printfModule("pass", BGT60_APP_LOGGER_SERVICE, BGT60_APP_LOGGER_COLOR);\
157#define BGT60_APP_LOG_MSG(str) { }
158#define BGT60_APP_LOG_VAR(str, var) { }
159#define BGT60_APP_LOG_RETURN(ret) { }
171#define BGT60_LOG_INIT() { }
172#define BGT60_LOG_DEINIT() { }
174#define BGT60_LOG_MSG(str) { }
175#define BGT60_LOG_RETURN(ret) { }
177#define BGT60_APP_LOG_MSG(str) { }
178#define BGT60_APP_LOG_VAR(str, var) { }
179#define BGT60_APP_LOG_RETURN(ret) { }
Radar BGT60 Library Configuration.
Radar BGT60 Logger Platform Abstraction Layer.
Definition bgt60-types.hpp:14