1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

Server: web API: implemented /sdrangel/logging GET

This commit is contained in:
f4exb 2017-12-18 13:39:31 +01:00
parent 8d447dc827
commit debdae9529
2 changed files with 21 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include "SWGInstanceSummaryResponse.h"
#include "SWGInstanceDevicesResponse.h"
#include "SWGInstanceChannelsResponse.h"
#include "SWGLoggingInfo.h"
#include "SWGErrorResponse.h"
#include "maincore.h"
@ -138,6 +139,22 @@ int WebAPIAdapterSrv::instanceChannels(
return 200;
}
int WebAPIAdapterSrv::instanceLoggingGet(
SWGSDRangel::SWGLoggingInfo& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
response.setDumpToFile(m_mainCore.m_logger->getUseFileLogger() ? 1 : 0);
if (response.getDumpToFile()) {
m_mainCore.m_logger->getLogFileName(*response.getFileName());
m_mainCore.m_logger->getFileMinMessageLevelStr(*response.getFileLevel());
}
m_mainCore.m_logger->getConsoleMinMessageLevelStr(*response.getConsoleLevel());
return 200;
}
void WebAPIAdapterSrv::getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList)
{
deviceSetList->init();

View File

@ -50,6 +50,10 @@ public:
SWGSDRangel::SWGInstanceChannelsResponse& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceLoggingGet(
SWGSDRangel::SWGLoggingInfo& response,
SWGSDRangel::SWGErrorResponse& error);
private:
MainCore& m_mainCore;