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 <piotr@scylladb.com>
This commit is contained in:
Piotr Jastrzebski
2020-01-21 16:28:50 +01:00
parent e1b22b6a4c
commit df1b7d2805
2 changed files with 14 additions and 0 deletions

View File

@@ -791,6 +791,16 @@ void db::config::maybe_in_workdir(named_value<string_list>& 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<>

View File

@@ -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);