Skip to content

Commit

Permalink
log: drop specialization of boost::lexical_cast for log_level
Browse files Browse the repository at this point in the history
log.hh contains a declaration of a specializtion of lexical_cast for
log_level, noting boost doesn't pick up operator<< for log_level,
but everything seems to work without the specialization. Dropping it
means we can drop yet another boost dependency in a commonly used
header file, one that pulls in much of the boost.ranges core.
  • Loading branch information
avikivity committed Dec 9, 2024
1 parent 72c7ac5 commit 80e4cec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
9 changes: 0 additions & 9 deletions include/seastar/util/log.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <atomic>
#include <mutex>
#include <type_traits>
#include <boost/lexical_cast.hpp>
#include <fmt/core.h>
#include <fmt/format.h>
#endif
Expand Down Expand Up @@ -72,14 +71,6 @@ struct fmt::formatter<seastar::log_level> {
auto format(seastar::log_level level, fmt::format_context& ctx) const -> decltype(ctx.out());
};

// Boost doesn't auto-deduce the existence of the streaming operators for some reason

namespace boost {
template<>
seastar::log_level lexical_cast(const std::string& source);

}

namespace seastar {
SEASTAR_MODULE_EXPORT_BEGIN
class logger;
Expand Down
12 changes: 0 additions & 12 deletions src/util/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -630,18 +630,6 @@ logging_settings extract_settings(const options& opts) {

}

}
namespace boost {
template<>
seastar::log_level lexical_cast(const std::string& source) {
std::istringstream in(source);
seastar::log_level level;
if (!(in >> level)) {
throw boost::bad_lexical_cast();
}
return level;
}

}

namespace std {
Expand Down

0 comments on commit 80e4cec

Please sign in to comment.