From fa85884d97d62214ea1490997d4560ed9774ef59 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Thu, 3 Nov 2022 09:33:53 -0700 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-11303 Signed-off-by: stephb9959 --- build | 2 +- src/framework/MicroServiceErrorHandler.h | 1 + src/framework/UI_WebSocketClientNotifications.h | 3 --- src/framework/WebSocketLogger.h | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build b/build index e440e5c..7813681 100644 --- a/build +++ b/build @@ -1 +1 @@ -3 \ No newline at end of file +5 \ No newline at end of file diff --git a/src/framework/MicroServiceErrorHandler.h b/src/framework/MicroServiceErrorHandler.h index 05d75d1..3a78aba 100644 --- a/src/framework/MicroServiceErrorHandler.h +++ b/src/framework/MicroServiceErrorHandler.h @@ -10,6 +10,7 @@ #include "Poco/Net/NetException.h" #include "Poco/Net/SSLException.h" #include "Poco/JSON/Template.h" +#include "Poco/JSON/JSONException.h" #include "Poco/Thread.h" namespace OpenWifi { diff --git a/src/framework/UI_WebSocketClientNotifications.h b/src/framework/UI_WebSocketClientNotifications.h index 934ae19..d534a5c 100644 --- a/src/framework/UI_WebSocketClientNotifications.h +++ b/src/framework/UI_WebSocketClientNotifications.h @@ -14,7 +14,6 @@ namespace OpenWifi { struct WebSocketNotification { inline static uint64_t xid = 1; uint64_t notification_id = ++xid; -// std::string type; std::uint64_t type_id=0; ContentStruct content; @@ -26,7 +25,6 @@ namespace OpenWifi { template void WebSocketNotification::to_json(Poco::JSON::Object &Obj) const { RESTAPI_utils::field_to_json(Obj, "notification_id", notification_id); -// RESTAPI_utils::field_to_json(Obj, "type", type); RESTAPI_utils::field_to_json(Obj, "type_id", type_id); RESTAPI_utils::field_to_json(Obj, "content", content); } @@ -35,7 +33,6 @@ namespace OpenWifi { bool WebSocketNotification::from_json(const Poco::JSON::Object::Ptr &Obj) { try { RESTAPI_utils::field_from_json(Obj, "notification_id", notification_id); - // RESTAPI_utils::field_from_json(Obj, "type", type); RESTAPI_utils::field_from_json(Obj, "type_id", type_id); RESTAPI_utils::field_from_json(Obj, "content", content); return true; diff --git a/src/framework/WebSocketLogger.h b/src/framework/WebSocketLogger.h index 28c1b8c..7c0553e 100644 --- a/src/framework/WebSocketLogger.h +++ b/src/framework/WebSocketLogger.h @@ -48,7 +48,7 @@ namespace OpenWifi { struct NotificationLogMessage { std::string msg; std::string level; - std::string timestamp; + std::uint64_t timestamp; std::string source; std::string thread_name; std::uint64_t thread_id=0; @@ -85,7 +85,7 @@ namespace OpenWifi { WebSocketClientNotificationLogMessage_t Msg; Msg.content.msg = m.getText(); Msg.content.level = WebSocketLogger::to_string(m.getPriority()); - Msg.content.timestamp = Poco::DateTimeFormatter::format(m.getTime(), Poco::DateTimeFormat::ISO8601_FORMAT); + Msg.content.timestamp = m.getTime().epochTime(); Msg.content.source = m.getSource(); Msg.content.thread_name = m.getThread(); Msg.content.thread_id = m.getTid();