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:
14
lib/log/GWLog.cpp
Normal file
14
lib/log/GWLog.cpp
Normal 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
12
lib/log/GwLog.h
Normal 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
|
||||
Reference in New Issue
Block a user