presence: Create ErrorReporter class
This class will, eventually, create event logs for missing fans.
This first commit will just create a stubbed out class if there is a
'reporting' section in the configuration JSON. From the JSON, the class
will pull out the value for the number of seconds to wait between first
detecting a fan is missing and creating the event log for it.
This requires a slight change to the existing JSON format, however the
JsonConfig class was updated to support both the old and new formats.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I991ea7cf0457448411e65f4c8e274bb2584d15f4
diff --git a/presence/json_parser.hpp b/presence/json_parser.hpp
index 9d99a40..38c76b9 100644
--- a/presence/json_parser.hpp
+++ b/presence/json_parser.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "error_reporter.hpp"
#include "fan.hpp"
#include "psensor.hpp"
#include "rpolicy.hpp"
@@ -94,6 +95,11 @@
static const std::map<std::string, rpolicyHandler> _rpolicies;
/**
+ * Class that handles reporting errors for missing fans.
+ */
+ std::unique_ptr<ErrorReporter> _reporter;
+
+ /**
* @brief Process the json config to extract the defined fan presence
* policies.
*