summaryrefslogtreecommitdiffstats
path: root/log_manager.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-07-26 11:22:44 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-08-05 12:49:54 -0500
commit3fb83b3787c8440e48d37eb4c488fa253d63a807 (patch)
tree85456b6d57833f840484d3817711f325e86e397c /log_manager.cpp
parentb60e7559cf72fd42cc860101167f02335641ba90 (diff)
downloadphosphor-logging-3fb83b3787c8440e48d37eb4c488fa253d63a807.tar.gz
phosphor-logging-3fb83b3787c8440e48d37eb4c488fa253d63a807.zip
Implement Logging.Create interface
This adds the xyz.openbmc_project.Logging.Create interface on the /xyz/openbmc_project/logging path. The interface provides a single method, Create, that allows one to create an event log. This is an alternative to using the report/commit functions provided by the phosphor-logging/elog.hpp header file. Unlike those report/commit interfaces, this does not require that the entries in the AdditionalData event log property be defined ahead of time, as the whole AdditionalData contents are just passed in instead of read out of the journal. This means that the error does not need to have been defined in the error and metadata YAML files for an event log to be successfully created. The discussion on if that is still desired anyway is outside the scope of this commit. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Icf3f740ab86605deeaeb955ff51aa2ef292f5af4
Diffstat (limited to 'log_manager.cpp')
-rw-r--r--log_manager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/log_manager.cpp b/log_manager.cpp
index 2920546..2acbfad 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -562,6 +562,16 @@ std::string Manager::readFWVersion()
return version;
}
+void Manager::create(const std::string& message, Entry::Level severity,
+ const std::map<std::string, std::string>& additionalData)
+{
+ // Convert the map into a vector of "key=value" strings
+ std::vector<std::string> ad;
+ metadata::associations::combine(additionalData, ad);
+
+ createEntry(message, severity, ad);
+}
+
} // namespace internal
} // namespace logging
} // namespace phosphor
OpenPOWER on IntegriCloud