refactored loggerfactory

This commit is contained in:
Neeflix
2018-07-16 22:47:00 +02:00
parent c37b1183ab
commit 0c7f26772a
2 changed files with 2 additions and 13 deletions

View File

@@ -7,9 +7,7 @@
#include "InputDriverFactory.h" #include "InputDriverFactory.h"
#include "utilities/LoggerFactory.hpp" #include "utilities/LoggerFactory.hpp"
#include "EventNotifier.h" #include "EventNotifier.h"
using namespace nlohmann; using namespace nlohmann;
@@ -20,14 +18,11 @@ namespace Input
std::shared_ptr<InputDriver> InputDriverFactory::get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream) std::shared_ptr<InputDriver> InputDriverFactory::get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream)
{ {
ConfigureLogger(); LoggerFactory::CreateInputLogger();
IBlockingQueue<Event>* event_queue = new BlockingQueue<Event>; IBlockingQueue<Event>* event_queue = new BlockingQueue<Event>;
std::shared_ptr<IEventNotifier> event_notifier = std::make_shared<EventNotifier>(event_queue); std::shared_ptr<IEventNotifier> event_notifier = std::make_shared<EventNotifier>(event_queue);
std::unique_ptr<IInputGPIOInterface> input_gpio_interface = std::make_unique<InputGPIOInterface>(input_config_stream); std::unique_ptr<IInputGPIOInterface> input_gpio_interface = std::make_unique<InputGPIOInterface>(input_config_stream);
std::unique_ptr<IDetector> detector(std::move(get_detector(matrix_config_stream, std::move(input_gpio_interface), event_notifier))); std::unique_ptr<IDetector> detector(std::move(get_detector(matrix_config_stream, std::move(input_gpio_interface), event_notifier)));
return std::shared_ptr<InputDriver>(new InputDriver(event_notifier, std::move(detector))); return std::shared_ptr<InputDriver>(new InputDriver(event_notifier, std::move(detector)));
@@ -70,10 +65,5 @@ std::map<char, Event> InputDriverFactory::create_input_events(json matrix_config
return events; return events;
} }
void InputDriverFactory::ConfigureLogger()
{
LoggerFactory::CreateInputTestLogger();
}
} }

View File

@@ -10,9 +10,8 @@
#include "config.h" #include "config.h"
class LoggerFactory namespace LoggerFactory
{ {
public:
static void CreateInputTestLogger() static void CreateInputTestLogger()
{ {
el::Loggers::getLogger(INPUT_LOGGER); el::Loggers::getLogger(INPUT_LOGGER);