]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/os: use compile-time validation
authorKefu Chai <kchai@redhat.com>
Mon, 17 May 2021 17:13:03 +0000 (01:13 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 17 May 2021 17:38:55 +0000 (01:38 +0800)
commite56263b057fbf8ceb542c8120c620865c3c48c1e
tree544b8c9a494179131b75763a5492811314ce5e18
parent68886f16ae6cca9b004d757c3d7e2af1a6de1797
crimson/os: use compile-time validation

libfmt does compile-time format argument validation of the format string
and the argument when the the user-defined literal is used. but the
downside is that the formatter materialize the whole formatted string
into a std::string, before printing them argument into seastar's log buffer
inserter. presumably, the inserter would be more efficient in
comparision to the pre-format approach. so this validation is only
enabled for non NDEBUG build. so it is able to help us to identify
errors like

DEBUG("{} {}", 1, 2, 3)

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/seastore/logging.h