Match error full name and namespace
Remove the addition of the extra "namespace Error" while generating
error full names, as the error full name doesn't have the extra "Error".
This extra namespace addition was being done to match up sdbusplus error
binding generation, but this will have to be re-looked at.
Change-Id: Ib99ce8e3a09dd76a23b8cc6fe7e706551a1699d6
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/logging_test.cpp b/logging_test.cpp
index ad51823..cb7548a 100644
--- a/logging_test.cpp
+++ b/logging_test.cpp
@@ -74,28 +74,28 @@
const char *test_string = "/tmp/test_string/";
try
{
- elog<example::xyz::openbmc_project::Example::Elog::Error::TestErrorOne>(
- example::xyz::openbmc_project::Example::Elog::Error::
+ elog<example::xyz::openbmc_project::Example::Elog::TestErrorOne>(
+ example::xyz::openbmc_project::Example::Elog::
TestErrorOne::ERRNUM(number),
- example::xyz::openbmc_project::Example::Elog::Error::
+ example::xyz::openbmc_project::Example::Elog::
TestErrorOne::FILE_PATH(test_string),
- example::xyz::openbmc_project::Example::Elog::Error::
+ example::xyz::openbmc_project::Example::Elog::
TestErrorOne::FILE_NAME("elog_test_3.txt"),
- example::xyz::openbmc_project::Example::Elog::Error::
+ example::xyz::openbmc_project::Example::Elog::
TestErrorTwo::DEV_ADDR(0xDEADDEAD),
- example::xyz::openbmc_project::Example::Elog::Error::
+ example::xyz::openbmc_project::Example::Elog::
TestErrorTwo::DEV_ID(100),
- example::xyz::openbmc_project::Example::Elog::Error::
+ example::xyz::openbmc_project::Example::Elog::
TestErrorTwo::DEV_NAME("test case 3"));
}
- catch (elogException<example::xyz::openbmc_project::Example::Elog::Error::
+ catch (elogException<example::xyz::openbmc_project::Example::Elog::
TestErrorOne>& e)
{
std::cout << "elog exception caught: " << e.what() << std::endl;
}
// Reduce our error namespaces
- using namespace example::xyz::openbmc_project::Example::Elog::Error;
+ using namespace example::xyz::openbmc_project::Example::Elog;
// Now read back and verify our data made it into the journal
std::stringstream stream;
diff --git a/tools/phosphor-logging/templates/elog-gen-template.mako.hpp b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
index e321e6b..9728d44 100644
--- a/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
+++ b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
@@ -28,8 +28,6 @@
namespace ${s}
{
% endfor
-namespace Error
-{
namespace _${classname}
{
<%
@@ -63,7 +61,7 @@
parent_name = tmpparent[-1]
## namespaces are all the name items except the last one
parent_namespace = '::'.join(tmpparent[:-1])
- parent_meta += [parent_namespace + "::Error::" + parent_name + "::" +
+ parent_meta += [parent_namespace + "::" + parent_name + "::" +
p for p in meta[parent]]
parent_meta_short = ', '.join(meta[parent])
if(meta_string):
@@ -86,7 +84,6 @@
using metadata_types = std::tuple<${meta_string}>;
};
-} // namespace Error
% for s in reversed(namespaces):
} // namespace ${s}
% endfor