From fa244f3321de7884f530bb38493a8d0a0cec86ab Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 8 Aug 2023 09:17:15 +0200 Subject: doc: Fix bitcoin-unterminated-logprintf tidy comments * Move module description from test to LogPrintfCheck * Add test doc * Remove unused comment, see https://github.com/bitcoin/bitcoin/pull/26296/files#r1279351539 --- contrib/devtools/bitcoin-tidy/example_logprintf.cpp | 5 ++--- contrib/devtools/bitcoin-tidy/logprintf.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib') diff --git a/contrib/devtools/bitcoin-tidy/example_logprintf.cpp b/contrib/devtools/bitcoin-tidy/example_logprintf.cpp index a3d2768964..d78fc2cd6c 100644 --- a/contrib/devtools/bitcoin-tidy/example_logprintf.cpp +++ b/contrib/devtools/bitcoin-tidy/example_logprintf.cpp @@ -2,9 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -// Warn about any use of LogPrintf that does not end with a newline. #include +// Test for bitcoin-unterminated-logprintf + enum LogFlags { NONE }; @@ -21,8 +22,6 @@ static inline void LogPrintf_(const std::string& logging_function, const std::st #define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__) #define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__) -// Use a macro instead of a function for conditional logging to prevent -// evaluating arguments when logging for the category is not enabled. #define LogPrint(category, ...) \ do { \ LogPrintf(__VA_ARGS__); \ diff --git a/contrib/devtools/bitcoin-tidy/logprintf.h b/contrib/devtools/bitcoin-tidy/logprintf.h index 466849ef01..db95dfe143 100644 --- a/contrib/devtools/bitcoin-tidy/logprintf.h +++ b/contrib/devtools/bitcoin-tidy/logprintf.h @@ -9,6 +9,7 @@ namespace bitcoin { +// Warn about any use of LogPrintf that does not end with a newline. class LogPrintfCheck final : public clang::tidy::ClangTidyCheck { public: -- cgit v1.2.3