diff --git a/locator/abstract_replication_strategy.hh b/locator/abstract_replication_strategy.hh index 3d074f9a91..d5b5313d82 100644 --- a/locator/abstract_replication_strategy.hh +++ b/locator/abstract_replication_strategy.hh @@ -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 _config_options; token_metadata& _token_metadata; snitch_ptr& _snitch; + + template + void err(const char* fmt, Args&&... args) const { + logger().error(fmt, std::forward(args)...); + } + + template + void warn(const char* fmt, Args&&... args) const { + logger().warn(fmt, std::forward(args)...); + } + + template + void debug(const char* fmt, Args&&... args) const { + logger().debug(fmt, std::forward(args)...); + } + void validate_replication_factor(sstring rf); virtual std::vector calculate_natural_endpoints(const token& search_token) = 0;