From df1b7d2805f1eccb68d033ed7a5832067e8adbe9 Mon Sep 17 00:00:00 2001 From: Piotr Jastrzebski Date: Tue, 21 Jan 2020 16:28:50 +0100 Subject: [PATCH] config: add operator<< for seed_provider_type Following patch will start checking allowed_values in named_value and print errors for wrong values. This will require all the types used with named_value to have operator<< implemented. seed_provider_type is one such type. Signed-off-by: Piotr Jastrzebski --- db/config.cc | 10 ++++++++++ db/config.hh | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/db/config.cc b/db/config.cc index a7a2fdd7cf..5d6e34a971 100644 --- a/db/config.cc +++ b/db/config.cc @@ -791,6 +791,16 @@ void db::config::maybe_in_workdir(named_value& tos, const char* sub const sstring db::config::default_tls_priority("SECURE128:-VERS-TLS1.0"); + +namespace db { + +std::ostream& operator<<(std::ostream& os, const db::seed_provider_type& s) { + os << "seed_provider_type{class=" << s.class_name << ", params=" << s.parameters << "}"; + return os; +} + +} + namespace utils { template<> diff --git a/db/config.hh b/db/config.hh index 6b44f9d6fd..6ff306acce 100644 --- a/db/config.hh +++ b/db/config.hh @@ -59,10 +59,14 @@ struct seed_provider_type { bool operator==(const seed_provider_type& other) const { return class_name == other.class_name && parameters == other.parameters; } + friend std::ostream& operator<<(std::ostream& os, const seed_provider_type&); }; +std::ostream& operator<<(std::ostream& os, const db::seed_provider_type& s); + } + namespace utils { sstring config_value_as_json(const db::seed_provider_type& v);