Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
24 lines
598 B
C++
24 lines
598 B
C++
#include <system/system.hpp>
|
|
#include <types.hpp>
|
|
#include <json.hpp>
|
|
#include <iostream>
|
|
#include <sstream>
|
|
#include <fstream>
|
|
#include <string>
|
|
|
|
#define SYSLOG_FILE "/var/log/messages"
|
|
namespace api
|
|
{
|
|
namespace system
|
|
{
|
|
void System::get_syslog(const httplib::Request& request, httplib::Response& response)
|
|
{
|
|
std::stringstream responsedata;
|
|
std::ifstream syslogfile(SYSLOG_FILE);
|
|
responsedata << syslogfile.rdbuf();
|
|
syslogfile.close();
|
|
response.set_content(responsedata.str(), PLAIN_TEXT_TYPE);
|
|
}
|
|
}
|
|
}
|