xref: /openbmc/telemetry/tests/src/helpers/labeled_tuple_helpers.hpp (revision 583ba441654657bb4ba9d051b747144a7258c159)
1dcc4e193SKrzysztof Grobelny #pragma once
2dcc4e193SKrzysztof Grobelny 
3dcc4e193SKrzysztof Grobelny #include "utils/labeled_tuple.hpp"
4dcc4e193SKrzysztof Grobelny 
5dcc4e193SKrzysztof Grobelny #include <iomanip>
6dcc4e193SKrzysztof Grobelny 
7dcc4e193SKrzysztof Grobelny namespace utils
8dcc4e193SKrzysztof Grobelny {
9dcc4e193SKrzysztof Grobelny 
10dcc4e193SKrzysztof Grobelny template <class... Args, class... Labels>
PrintTo(const LabeledTuple<std::tuple<Args...>,Labels...> & labeledTuple,std::ostream * os)11*583ba441SPatrick Williams inline void PrintTo(
12*583ba441SPatrick Williams     const LabeledTuple<std::tuple<Args...>, Labels...>& labeledTuple,
13dcc4e193SKrzysztof Grobelny     std::ostream* os)
14dcc4e193SKrzysztof Grobelny {
15dcc4e193SKrzysztof Grobelny     nlohmann::json json;
16dcc4e193SKrzysztof Grobelny     to_json(json, labeledTuple);
17dcc4e193SKrzysztof Grobelny 
18dcc4e193SKrzysztof Grobelny     (*os) << std::setw(2) << json;
19dcc4e193SKrzysztof Grobelny }
20dcc4e193SKrzysztof Grobelny 
21dcc4e193SKrzysztof Grobelny } // namespace utils
22