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
pull/28237/head
MarcoFalke 1 year ago
parent b565485c24
commit fa244f3321
No known key found for this signature in database

@ -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__); \

@ -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:

Loading…
Cancel
Save