summaryrefslogtreecommitdiffstats
path: root/elog_meta.hpp
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-02-27 07:07:33 -0600
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-15 09:20:14 -0500
commit16e8754504906eaea0c8b4aba23e96fef3e5285c (patch)
treede197b471be13fb008bdd53737b22091974183bf /elog_meta.hpp
parent89d6be41db901e1c5b571298ca613f365cdf1e1c (diff)
downloadphosphor-logging-16e8754504906eaea0c8b4aba23e96fef3e5285c.tar.gz
phosphor-logging-16e8754504906eaea0c8b4aba23e96fef3e5285c.zip
metadata: add interface to build associations
A metadata field found in the journal corresponding to an error could be special in the sense that it may require building specific error association objects. Add an interface to build such associations. Take advantage of the fact that every metadata has a corresponding type defined. Change-Id: I09e446879667044c009141443fc0dc6fed8a8b18 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'elog_meta.hpp')
-rw-r--r--elog_meta.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/elog_meta.hpp b/elog_meta.hpp
new file mode 100644
index 0000000..9fc591d
--- /dev/null
+++ b/elog_meta.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <vector>
+#include <string>
+#include <phosphor-logging/elog-errors.hpp>
+#include "elog_entry.hpp"
+
+namespace phosphor
+{
+namespace logging
+{
+namespace metadata
+{
+
+using Metadata = std::string;
+
+namespace associations
+{
+
+using Type = void(const std::string&,
+ const std::vector<std::string>&,
+ AssociationList& list);
+
+/** @brief Build error associations specific to metadata. Specialize this
+ * template for handling a specific type of metadata.
+ * @tparam M - type of metadata
+ * @param [in] data - metadata to be handled
+ * @param [in] data - metadata key=value entries
+ * @param [out] list - list of error association objects
+ */
+template <typename M>
+void build(const std::string& match,
+ const std::vector<std::string>& data,
+ AssociationList& list) = delete;
+
+} // namespace associations
+} // namespace metadata
+} // namespace logging
+} // namespace phosphor
OpenPOWER on IntegriCloud