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

make logging thread safe

This commit is contained in:
andreas
2021-11-06 14:32:14 +01:00
parent 180ca4b785
commit 99beb82014
2 changed files with 14 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ class GwLog{
char buffer[100];
int logLevel=1;
GwLogWriter *writer;
SemaphoreHandle_t locker;
public:
static const int LOG=1;
static const int ERROR=0;
@@ -19,6 +20,7 @@ class GwLog{
static const int TRACE=2;
String prefix="LOG:";
GwLog(int level=LOG, GwLogWriter *writer=NULL);
~GwLog();
void setWriter(GwLogWriter *writer);
void logString(const char *fmt,...);
void logDebug(int level, const char *fmt,...);