1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -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 "SWGInstanceSummaryResponse.h"
#include "SWGInstanceDevicesResponse.h" #include "SWGInstanceDevicesResponse.h"
#include "SWGInstanceChannelsResponse.h" #include "SWGInstanceChannelsResponse.h"
#include "SWGLoggingInfo.h"
#include "SWGErrorResponse.h" #include "SWGErrorResponse.h"
#include "maincore.h" #include "maincore.h"
@ -138,6 +139,22 @@ int WebAPIAdapterSrv::instanceChannels(
return 200; 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) void WebAPIAdapterSrv::getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList)
{ {
deviceSetList->init(); deviceSetList->init();

View File

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