aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-08-08 09:17:15 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-08-08 09:11:05 +0200
commitfa244f3321de7884f530bb38493a8d0a0cec86ab (patch)
treecee4a8b0834adf4f95be5a22efe3f97930bcc074 /contrib
parentb565485c24c0feacae559a7f6f7b83d7516ca58d (diff)
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
Diffstat (limited to 'contrib')
-rw-r--r--contrib/devtools/bitcoin-tidy/example_logprintf.cpp5
-rw-r--r--contrib/devtools/bitcoin-tidy/logprintf.h1
2 files changed, 3 insertions, 3 deletions
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 <string>
+// 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: