Hi,
Im using my own debugger print with some color and the name of the class where it is implemented as a .h file
#define LOG(x, ...) { Serial.println("\x1b[34m"DEBUG": \x1b[39m"x"\x1b[39;49m");}
Which Im using like this
#define DEBUG "DRV8825 Motordriver"
#include "h_logger.h"
If im using it like this
LOG("Setting Motor Power to ");
there is no problem but these two give me an error. With state as uint8_t
LOG("Setting Motor Power to " + state);
or even
String debugString = "test123";
LOG(debugString);
The error is the following
In file included from drv8825.cpp:4:0:
drv8825.cpp: In member function 'void drv8825::powerOn(bool)':
drv8825.cpp:68: error: expected ')' before 'debugString'
LOG(debugString);
^
h_logger.h:7:66: note: in definition of macro 'LOG'
#define LOG(x, ...) { Serial.println("\x1b[34m"DEBUG": \x1b[39m"x"\x1b[39;49m");}
^
expected ')' before 'debugString'