Add DMR Master logging-in to the JSON status messages.

This commit is contained in:
Jonathan Naylor
2023-07-23 14:30:49 +01:00
parent 852caca96e
commit 8ca1bb8d72
6 changed files with 23 additions and 16 deletions

11
Log.cpp
View File

@@ -18,6 +18,7 @@
#include "Log.h"
#include "MQTTConnection.h"
#include "Utils.h"
#if defined(_WIN32) || defined(_WIN64)
#include <Windows.h>
@@ -94,6 +95,16 @@ void Log(unsigned int level, const char* fmt, ...)
exit(1);
}
void WriteJSONStatus(const std::string& status)
{
nlohmann::json json;
json["timestamp"] = CUtils::createTimestamp();
json["message"] = status;
WriteJSON("status", json);
}
void WriteJSON(const std::string& topLevel, nlohmann::json& json)
{
if (m_mqtt != NULL) {