1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

intermediate: restructure wifi,log

This commit is contained in:
andreas
2021-10-17 15:41:35 +02:00
parent ec67767ca6
commit 0fe10aeef8
8 changed files with 185 additions and 116 deletions

14
lib/log/GWLog.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include "GwLog.h"
GwLog::GwLog(bool logSerial){
this->logSerial=logSerial;
}
void GwLog::logString(const char *fmt,...){
va_list args;
va_start(args,fmt);
vsnprintf(buffer,99,fmt,args);
if (logSerial){
Serial.print("LOG: ");
Serial.println(buffer);
}
}

12
lib/log/GwLog.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef _GWLOG_H
#define _GWLOG_H
#include <Arduino.h>
class GwLog{
private:
char buffer[100];
bool logSerial=false;
public:
GwLog(bool logSerial);
void logString(const char *fmt,...);
};
#endif