formats log messages (at least for default)

pull/2687/head
Bailey Chittle 3 years ago
parent f09a0922eb
commit a37be70b3b

@ -12,8 +12,8 @@ namespace details {
struct attr struct attr
{ {
std::string key; std::string_view key;
std::string value; std::string_view value;
public: public:
attr(std::initializer_list<std::string_view> l) { attr(std::initializer_list<std::string_view> l) {

@ -1010,6 +1010,16 @@ public:
} }
// fmt_helper::append_string_view(msg.msg(), dest); // fmt_helper::append_string_view(msg.msg(), dest);
fmt_helper::append_string_view(msg.payload, dest); fmt_helper::append_string_view(msg.payload, dest);
if (msg.attributes.size() > 0) {
fmt_helper::append_string_view(" | ", dest);
for (const details::attr& a : msg.attributes) {
fmt_helper::append_string_view(a.key, dest);
fmt_helper::append_string_view("=\"", dest);
fmt_helper::append_string_view(a.value, dest);
fmt_helper::append_string_view("\", ", dest);
}
}
} }
private: private:

Loading…
Cancel
Save