Add Logging.Create Interface
This interface, when implemented by phosphor-logging, would allow one
to create xyz.openbmc_project.Logging.Entry objects via a Create D-Bus
method call.
This interface was designed for the following reasons:
1) Bypass the current step of creating an error log which involves
searching the journal for specific predefined metadata keywords and
just make the D-Bus call to the logging server directly to create
the error. This means the code would no longer need to include the
phosphor-logging elog-errors.hpp header, which has an added bonus of
not requiring the bbappends that are currently required to tell
phosphor-logging about any error YAML files outside of the main repo.
2) As these errors are no longer are involved in the elog() exceptions
that are thrown across D-Bus calls by sdbusplus, there is no longer a
need to include the xyz/openbmc_project/.../error.hpp sdbusplus
headers, which were required even for errors that the developer never
had any intent on returning from D-Bus calls.
Change-Id: I297b04bb81d507ec31ffcd489109f56dd8888afb
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/xyz/openbmc_project/Logging/Create.interface.yaml b/xyz/openbmc_project/Logging/Create.interface.yaml
new file mode 100644
index 0000000..f94183d
--- /dev/null
+++ b/xyz/openbmc_project/Logging/Create.interface.yaml
@@ -0,0 +1,30 @@
+description: >
+ This interface contains a Create method, which can be implemented
+ to allow creation of xyz.openbmc_project.Logging.Entry objects
+ directly over D-Bus, without needing the errors defined in
+ the *.Error/metadata.yaml files.
+
+methods:
+ - name: Create
+ description: >
+ Create a xyz.openbmc_project.Logging.Entry object.
+ parameters:
+ - name: Message
+ type: string
+ description: >
+ The Message property of the event entry.
+ - name: Severity
+ type: enum[xyz.openbmc_project.Logging.Entry.Level]
+ description: >
+ The Severity property of the event entry.
+ - name: AdditionalData
+ type: dict[string, string]
+ description: >
+ The AdditionalData property of the event entry.
+ e.g.:
+ {
+ "key1": "value1",
+ "key2": "value2"
+ }
+ ends up in AdditionaData like:
+ ["KEY1=value1", "KEY2=value2"]