blob: 8461f7023ce29934f31d038fb76db234223e8c5b [file] [log] [blame]
Andrew Geisslerc830e0f2016-10-18 12:51:29 -05001## Note that this file is not auto generated, it is what generates the
2## elog-gen.hpp file
3// This file was autogenerated. Do not edit!
4// See elog-gen.py for more details
5#pragma once
6
7#include <tuple>
8#include <type_traits>
9#include "log.hpp"
10
11namespace phosphor
12{
13
14namespace logging
15{
16
17 % for a in errors:
18namespace _${errors[a]}
19{
20 % for b in meta[a]:
21struct ${b}
22{
23 static constexpr auto str = "${meta_data[b]['str']}";
24 static constexpr auto str_short = "${meta_data[b]['str_short']}";
25 using type = std::tuple<std::decay_t<decltype(str)>,${meta_data[b]['type']}>;
26 explicit constexpr ${b}(${meta_data[b]['type']} a) : _entry(entry(str, a)) {};
27 type _entry;
28};
29 % endfor
30
31} // namespace _${errors[a]}
32<% meta_string = ', '.join(meta[a]) %>
33struct ${errors[a]}
34{
35 static constexpr auto err_code = "xyz.openbmc_project.logging.${errors[a]}";
36 static constexpr auto err_msg = "${error_msg[errors[a]]}";
37 static constexpr auto L = level::${error_lvl[errors[a]]};
38 % for b in meta[a]:
39 using ${b} = _${errors[a]}::${b};
40 % endfor
41 using metadata_types = std::tuple<${meta_string}>;
42};
43
44 % endfor
45
46} // namespace logging
47
48} // namespace phosphor