Skip to content

Commit

Permalink
crimson/os/seastore: drop compile-time fmt validation
Browse files Browse the repository at this point in the history
_format() was deprecated in fmtlib v8, see also
fmtlib/fmt#2646

Signed-off-by: Kefu Chai <[email protected]>
(cherry picked from commit 3fd91d7)
  • Loading branch information
tchaikov committed Aug 15, 2022
1 parent 504d03e commit a9d551c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/crimson/os/seastore/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#define LOGGER(subname_) crimson::get_logger(ceph_subsys_##subname_)
#define LOG_PREFIX(x) constexpr auto FNAME = #x

#ifdef NDEBUG

#define LOG(level_, MSG, ...) \
LOCAL_LOGGER.log(level_, "{}: " MSG, FNAME , ##__VA_ARGS__)
#define LOGT(level_, MSG, t, ...) \
Expand All @@ -23,26 +21,6 @@
#define SUBLOGT(subname_, level_, MSG, t, ...) \
LOGGER(subname_).log(level_, "{}({}): " MSG, FNAME, (void*)&t , ##__VA_ARGS__)

#else

// do compile-time format string validation
using namespace fmt::literals;
template<seastar::log_level lv>
void _LOG(seastar::logger& logger, std::string_view info) {
logger.log(lv, info.data());
}

#define LOG(level_, MSG, ...) \
_LOG<level_>(LOCAL_LOGGER, "{}: " MSG ## _format(FNAME , ##__VA_ARGS__))
#define LOGT(level_, MSG, t_, ...) \
_LOG<level_>(LOCAL_LOGGER, "{}({}): " MSG ## _format(FNAME, (void*)&t_ , ##__VA_ARGS__))
#define SUBLOG(subname_, level_, MSG, ...) \
_LOG<level_>(LOGGER(subname_), "{}: " MSG ## _format(FNAME , ##__VA_ARGS__))
#define SUBLOGT(subname_, level_, MSG, t_, ...) \
_LOG<level_>(LOGGER(subname_), "{}({}): " MSG ## _format(FNAME, (void*)&t_ , ##__VA_ARGS__))

#endif

#define TRACE(...) LOG(seastar::log_level::trace, __VA_ARGS__)
#define TRACET(...) LOGT(seastar::log_level::trace, __VA_ARGS__)
#define SUBTRACE(subname_, ...) SUBLOG(subname_, seastar::log_level::trace, __VA_ARGS__)
Expand Down

0 comments on commit a9d551c

Please sign in to comment.