1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

introduce debug log

This commit is contained in:
andreas
2021-10-24 16:51:47 +02:00
parent 149ffb7a5f
commit 2057b70cb7
3 changed files with 25 additions and 4 deletions

View File

@@ -5,8 +5,17 @@ class GwLog{
private:
char buffer[100];
bool logSerial=false;
int logLevel=1;
public:
GwLog(bool logSerial);
static const int LOG=1;
static const int ERROR=0;
static const int DEBUG=3;
static const int TRACE=2;
GwLog(bool logSerial,int level=LOG);
void logString(const char *fmt,...);
void logDebug(int level, const char *fmt,...);
int isActive(int level){return level <= logLevel;};
};
#define LOG_DEBUG(level,fmt,...){ if (logger->isActive(level)) logger->logDebug(level,fmt,__VA_ARGS__);}
#endif