summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2017-01-24 12:34:23 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2017-01-30 12:57:25 -0600
commitf542ba8271617afa73117a6a194572719760d734 (patch)
treef4c0222547f162f00102e0322f84ed2b725078e4 /tools
parentdf995faf2588743c187066b505e95e9f56f6f5ae (diff)
downloadphosphor-logging-f542ba8271617afa73117a6a194572719760d734.tar.gz
phosphor-logging-f542ba8271617afa73117a6a194572719760d734.zip
Create a map to get the priority level for the error
Delete unused elog-lookup-template.mako.cpp file and update the one in the tools directory. Example of generated code for reference: std::map<std::string,level> g_errLevelMap = { {"TestErrorOne",level::INFO}, {"TestErrorTwo",level::ERR}, }; Change-Id: I5dcf47cb4827f80aa7a04bbe2beb181e28d7dafc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/phosphor-logging/templates/elog-lookup-template.mako.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp b/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp
index e53067a..8e022ce 100644
--- a/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp
+++ b/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp
@@ -4,6 +4,7 @@
// See elog-gen.py for more details
#include <map>
#include <vector>
+#include "log.hpp"
namespace phosphor
{
@@ -18,6 +19,13 @@ std::map<std::string,std::vector<std::string>> g_errMetaMap = {
% endfor
};
+std::map<std::string,level> g_errLevelMap = {
+ % for a in errors:
+ <% meta_string = '\",\"'.join(meta[a]) %> \
+ {"${a}",level::${error_lvl[a]}},
+ % endfor
+};
+
} // namespace logging
} // namespace phosphor
OpenPOWER on IntegriCloud