fixing logging

This commit is contained in:
Torsten Ruger
2021-07-03 20:49:43 +03:00
parent 1785f07706
commit 9c6b39fd50
5 changed files with 32 additions and 24 deletions

View File

@ -5,15 +5,22 @@ class WsSerial{
std::queue<String> debug;
public:
inline void print(const String& line){ debug.push(line); }
inline void println(const String& line){ debug.push(line); }
inline void print(const String& line){
// enable debug the debugging Serial.println(line.c_str());
debug.push(line);
}
inline void println(const String& line){
// enable debug the debugging Serial.println(line.c_str());
debug.push(line);
}
inline void println(const float num){ println(String(num)) ; };
inline const String& pop(){ const String& first = debug.front(); debug.pop(); return first;};
inline const String& first(){ return debug.front();};
inline void pop(){ debug.pop(); };
inline bool empty(){ return debug.empty();};
};
static WsSerial debug_out;
extern WsSerial debug_out;
#if(false)
#define DEBUG_OUT Serial

View File

@ -1,10 +1,8 @@
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncEventSource.h>
#include <LittleFS.h>
static AsyncWebServer server(80);
static AsyncEventSource events("/events");
void server_setup();
void server_loop();