locator: abstract_replication_strategy: added replication_strategy_logger
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This commit is contained in:
@@ -21,6 +21,13 @@ using inet_address = gms::inet_address;
|
||||
using token = dht::token;
|
||||
|
||||
class abstract_replication_strategy {
|
||||
private:
|
||||
static logging::logger& logger() {
|
||||
static thread_local logging::logger lgr("replication_strategy_logger");
|
||||
|
||||
return lgr;
|
||||
}
|
||||
|
||||
protected:
|
||||
sstring _ks_name;
|
||||
// TODO: Do we need this member at all?
|
||||
@@ -28,6 +35,22 @@ protected:
|
||||
std::map<sstring, sstring> _config_options;
|
||||
token_metadata& _token_metadata;
|
||||
snitch_ptr& _snitch;
|
||||
|
||||
template <typename... Args>
|
||||
void err(const char* fmt, Args&&... args) const {
|
||||
logger().error(fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void warn(const char* fmt, Args&&... args) const {
|
||||
logger().warn(fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void debug(const char* fmt, Args&&... args) const {
|
||||
logger().debug(fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void validate_replication_factor(sstring rf);
|
||||
|
||||
virtual std::vector<inet_address> calculate_natural_endpoints(const token& search_token) = 0;
|
||||
|
||||
Reference in New Issue
Block a user