More fixes for logging
This commit is contained in:
parent
21ce6d5870
commit
4900c36e0b
|
@ -40,7 +40,7 @@ class LoggingAPI
|
||||||
const auto endIt = logger->end();
|
const auto endIt = logger->end();
|
||||||
|
|
||||||
StaticJsonDocument<512> data;
|
StaticJsonDocument<512> data;
|
||||||
for(auto it = beginIt; it != endIt; ++beginIt) {
|
for(auto it = beginIt; it != endIt; ++it) {
|
||||||
data["time"] = it.time_millis();
|
data["time"] = it.time_millis();
|
||||||
data["msg"] = it.message();
|
data["msg"] = it.message();
|
||||||
server.template sendToAll<512>(MessageCode::LOG_UPDATE, data);
|
server.template sendToAll<512>(MessageCode::LOG_UPDATE, data);
|
||||||
|
@ -51,7 +51,7 @@ class LoggingAPI
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool running_ = false;
|
bool running_ = false;
|
||||||
Logger::iterator lastEnd_;
|
Logger::iterator lastEnd_ = Logger::iterator(nullptr);
|
||||||
bool firstCall_ = false;
|
bool firstCall_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "WebsocketServer.h"
|
#include "WebsocketServer.h"
|
||||||
#include "SessionAPI.h"
|
#include "SessionAPI.h"
|
||||||
#include "WifiAPI.h"
|
#include "WifiAPI.h"
|
||||||
|
#include "LoggingAPI.h"
|
||||||
|
|
||||||
using Session_T = SimpleMeasurementSession<MeasurementT, CONFIG_SESSION_MAX_SIZE>;
|
using Session_T = SimpleMeasurementSession<MeasurementT, CONFIG_SESSION_MAX_SIZE>;
|
||||||
SessionManager<Session_T> sessionManager;
|
SessionManager<Session_T> sessionManager;
|
||||||
|
@ -35,7 +36,7 @@ EspHttp espHttpServer;
|
||||||
|
|
||||||
WifiManager wifiManager;
|
WifiManager wifiManager;
|
||||||
|
|
||||||
auto apiTuple = std::make_tuple(SessionAPI<Session_T>(sessionManager), WifiAPI(wifiManager));
|
auto apiTuple = std::make_tuple(SessionAPI<Session_T>(sessionManager), WifiAPI(wifiManager), LoggingAPI());
|
||||||
WebsocketServer<decltype(apiTuple)> websocketServer(81, apiTuple);
|
WebsocketServer<decltype(apiTuple)> websocketServer(81, apiTuple);
|
||||||
|
|
||||||
//WebsocketServer<Session_T> webSocketServer(sessionManager, userStorage, 81);
|
//WebsocketServer<Session_T> webSocketServer(sessionManager, userStorage, 81);
|
||||||
|
|
Loading…
Reference in New Issue