Adapts logging

This commit is contained in:
Johannes Wendel
2020-01-06 22:01:18 +01:00
parent bfcc5b86ea
commit 4b76b477f5
23 changed files with 94 additions and 59 deletions

View File

@@ -12,10 +12,10 @@ namespace input
DistributingEvent::DistributingEvent(uint8_t address, int priority, std::string name,
std::chrono::milliseconds bounce_time, std::shared_ptr<EventNotifier> event_notifier)
:
Event(address, priority, std::move(name)),
bounce_time(bounce_time),
event_notifier(std::move(event_notifier)),
activation_state(NOT_ACTIVATED)
Event(address, priority, std::move(name)),
bounce_time(bounce_time),
event_notifier(std::move(event_notifier)),
activation_state(NOT_ACTIVATED)
{}
void DistributingEvent::distribute()

View File

@@ -18,7 +18,7 @@ namespace input
Event::Event(uint8_t address, int priority, std::string name) :
address(address), priority(priority), name(name)
{
//CLOG_IF(VLOG_IS_ON(0), INFO, INPUT_LOGGER) << "Created event: " << name << ", address: " << address;
CLOG_IF(VLOG_IS_ON(0), DEBUG, INPUT_LOGGER) << "Created event: " << name << ", address: " << address;
}
std::string Event::getJsonString()

View File

@@ -18,13 +18,13 @@ namespace input
namespace detail
{
Detector::Detector(std::unique_ptr<InputPinController> input_pin_controller, std::vector<std::shared_ptr<DistributingEvent>> events)
:
input_pin_controller(std::move(input_pin_controller)), events(std::move(events)), is_running(true)
Detector::Detector(std::unique_ptr<InputPinController> input_pin_controller, std::vector<std::shared_ptr<DistributingEvent>> events) :
input_pin_controller(std::move(input_pin_controller)), events(std::move(events)), is_running(true)
{
this->detect_thread = std::thread(&Detector::detect, this);
CLOG(INFO, INPUT_LOGGER) << "Created Detector and started detecting!";
CLOG(DEBUG, INPUT_LOGGER) << "Created Detector";
CLOG(INFO, INPUT_LOGGER) << "Detector thread running. Occuring input-events should get detected now!";
}
Detector::~Detector()

View File

@@ -22,7 +22,7 @@ event_queue(queue)
{
this->notify_thread = std::thread(&EventNotifier::notify, this);
CLOG(INFO, INPUT_LOGGER) << "Created EventNotifier and started thread";
CLOG(DEBUG, INPUT_LOGGER) << "Created EventNotifier and started thread";
}
EventNotifier::~EventNotifier()

View File

@@ -19,7 +19,7 @@ InputDriver::InputDriver(std::shared_ptr<EventNotifier> event_notifier, std::uni
std::map<std::string, std::shared_ptr<Event>> events) :
event_notifier(std::move(event_notifier)), detector(std::move(detector)), events(std::move(events))
{
CLOG(INFO, INPUT_LOGGER) << "Created InputDriver";
CLOG(INFO, INPUT_LOGGER) << "InputDriver created and running.";
}
void InputDriver::register_event_handler(std::shared_ptr<EventHandler> handler)