Added logger for outputrequesthandler

This commit is contained in:
Johannes Wendel
2019-10-24 22:20:08 +02:00
parent 250a3c8f14
commit 2161b16fa1
2 changed files with 6 additions and 0 deletions

View File

@@ -96,6 +96,11 @@ void OutputRequestHandler::handleRequest(HTTPServerRequest &request,
boost::optional<Poco::JSON::Object> OutputRequestHandler::parseRequest(const std::string& item_type, const std::string& item_name, const std::string& action, const std::string& score) boost::optional<Poco::JSON::Object> OutputRequestHandler::parseRequest(const std::string& item_type, const std::string& item_name, const std::string& action, const std::string& score)
{ {
std::string log_msg = "Got request from client to " + action + " " + item_type + " with name " + item_name + " (" + score + ")";
Poco::Logger::root().information(log_msg);
if(item_type == "solenoids") if(item_type == "solenoids")
{ {
return parseSolenoid(item_name, action); return parseSolenoid(item_name, action);

View File

@@ -10,6 +10,7 @@
#include <Poco/JSON/JSON.h> #include <Poco/JSON/JSON.h>
#include <memory> #include <memory>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <Poco/Logger.h>
#include <Poco/JSON/Object.h> #include <Poco/JSON/Object.h>
#include "output/OutputDriver.h" #include "output/OutputDriver.h"