summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--logging_test.cpp13
-rwxr-xr-xtools/elog-gen.py3
-rw-r--r--tools/phosphor-logging/templates/elog-gen-template.mako.hpp11
3 files changed, 23 insertions, 4 deletions
diff --git a/logging_test.cpp b/logging_test.cpp
index b781482..6a5f07f 100644
--- a/logging_test.cpp
+++ b/logging_test.cpp
@@ -81,7 +81,13 @@ int main()
example::xyz::openbmc_project::Example::TestErrorOne::
FILE_PATH(test_string),
example::xyz::openbmc_project::Example::TestErrorOne::
- FILE_NAME("elog_test_3.txt"));
+ FILE_NAME("elog_test_3.txt"),
+ example::xyz::openbmc_project::Example::TestErrorTwo::
+ DEV_ADDR(0xDEAD),
+ example::xyz::openbmc_project::Example::TestErrorTwo::
+ DEV_ID(0x100),
+ example::xyz::openbmc_project::Example::TestErrorTwo::
+ DEV_NAME("test case 3"));
}
catch (elogException<example::xyz::openbmc_project::Example::TestErrorOne>& e)
{
@@ -115,7 +121,10 @@ int main()
{
elog<TestErrorOne>(TestErrorOne::ERRNUM(number),
prev_entry<TestErrorOne::FILE_PATH>(),
- TestErrorOne::FILE_NAME("elog_test_4.txt"));
+ TestErrorOne::FILE_NAME("elog_test_4.txt"),
+ TestErrorTwo::DEV_ADDR(0xDEAD),
+ TestErrorTwo::DEV_ID(0x100),
+ TestErrorTwo::DEV_NAME("test case 4"));
}
catch (elogExceptionBase& e)
{
diff --git a/tools/elog-gen.py b/tools/elog-gen.py
index a6fdb1f..e9f4fc0 100755
--- a/tools/elog-gen.py
+++ b/tools/elog-gen.py
@@ -151,7 +151,8 @@ def gen_elog_hpp(i_yaml_dir, i_output_hpp,
f.write(template.render(
errors=errors, error_msg=error_msg,
error_lvl=error_lvl, meta=meta,
- meta_data=meta_data, error_namespace=i_error_namespace))
+ meta_data=meta_data, error_namespace=i_error_namespace,
+ parents=parents))
f.close()
diff --git a/tools/phosphor-logging/templates/elog-gen-template.mako.hpp b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
index 4222f08..e39deea 100644
--- a/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
+++ b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
@@ -42,7 +42,16 @@ struct ${b}
% endfor
} // namespace _${classname}
-<% meta_string = ', '.join(meta[name]) %>
+<%
+ meta_string = ', '.join(meta[name])
+
+ parent = parents[name]
+ while parent:
+ parent_meta = [parent + "::" + p for p in meta[parent]]
+ parent_meta = ', '.join(parent_meta)
+ meta_string = meta_string + ", " + parent_meta
+ parent = parents[parent]
+%>
struct ${classname}
{
static constexpr auto err_code = "${name}";
OpenPOWER on IntegriCloud