Skip to content

Commit fa244f3

Browse files
author
MarcoFalke
committed
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
1 parent b565485 commit fa244f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

contrib/devtools/bitcoin-tidy/example_logprintf.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
// Warn about any use of LogPrintf that does not end with a newline.
65
#include <string>
76

7+
// Test for bitcoin-unterminated-logprintf
8+
89
enum LogFlags {
910
NONE
1011
};
@@ -21,8 +22,6 @@ static inline void LogPrintf_(const std::string& logging_function, const std::st
2122
#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
2223
#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
2324

24-
// Use a macro instead of a function for conditional logging to prevent
25-
// evaluating arguments when logging for the category is not enabled.
2625
#define LogPrint(category, ...) \
2726
do { \
2827
LogPrintf(__VA_ARGS__); \

contrib/devtools/bitcoin-tidy/logprintf.h

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace bitcoin {
1111

12+
// Warn about any use of LogPrintf that does not end with a newline.
1213
class LogPrintfCheck final : public clang::tidy::ClangTidyCheck
1314
{
1415
public:

0 commit comments

Comments
 (0)