more colors

This commit is contained in:
Wolfgang Hottgenroth 2020-11-03 18:02:36 +01:00
parent 747cbd3658
commit 28876eaa14
3 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,8 @@ typedef enum {
LOG_HIGH,
LOG_RED,
LOG_GREEN,
LOG_BLUE
LOG_BLUE,
LOG_YELLOW
} t_logColor;
// initialize the logger, creates a ringbuffer

View File

@ -112,6 +112,7 @@ int coloredMsg(const t_logColor color, const char *format, ...) {
const static char RED[] = "\x1b[31;1m";
const static char GREEN[] = "\x1b[32;1m";
const static char BLUE[] = "\x1b[34;1m";
const static char YELLOW[] = "\x1b[33;1m";
const char *pre = NULL;
switch (color) {
case LOG_HIGH:
@ -126,6 +127,9 @@ int coloredMsg(const t_logColor color, const char *format, ...) {
case LOG_GREEN:
pre = GREEN;
break;
case LOG_YELLOW:
pre = YELLOW;
break;
}
va_list vl;
va_start(vl, format);

View File

@ -149,7 +149,7 @@ static void parseAndPrintFrame(t_mbusCommHandle *mbusCommHandle) {
for (uint8_t j = 0; j < MBUSDEVICE_NUM_OF_CONSIDEREDFIELDS; j++) {
if ((mbusCommHandle->device->consideredField[j].index == i) &&
(strlen(mbusCommHandle->device->consideredField[j].label) > 0)) {
coloredMsg(LOG_BLUE, "papf txt: I:%d, L:%s, U:%s V:%s",
coloredMsg(LOG_YELLOW, "papf txt: I:%d, L:%s, U:%s V:%s",
i,
mbusCommHandle->device->consideredField[j].label,
mbus_data_record_unit(record),
@ -419,7 +419,6 @@ e_mbusCommRequestResult mbusCommRequest(t_mbusDevice *mbusDevice) {
e_mbusCommRequestResult res = MBCRR_BUSY;
if (mbusCommHandle.state == MBCS_IDLE) {
logMsg("");
coloredMsg(LOG_BLUE, "*** NEW REQUEST %s R:%d F:%d C:%d ***",
mbusDevice->deviceName,
mbusDevice->requests,