From 2407a51d3e45c015f64e35bd9d4aaeded47c4567 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 12 Mar 2024 21:27:55 +0100 Subject: [PATCH] refactor: Remove unused LogPrintf --- doc/developer-notes.md | 3 +-- src/logging.h | 3 --- src/test/logging_tests.cpp | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index eb5c1917900..f6ab4c06d9e 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -753,8 +753,7 @@ logging messages. They should be used as follows: messages or for infrequent and important events such as a new block tip being found or a new outbound connection being made. These log messages are unconditional, so care must be taken that they can't be used by an - attacker to fill up storage. Note that `LogPrintf(fmt, params...)` is - a deprecated alias for `LogInfo`. + attacker to fill up storage. - `LogError(fmt, params...)` should be used in place of `LogInfo` for severe problems that require the node (or a subsystem) to shut down diff --git a/src/logging.h b/src/logging.h index fdc12c79b32..58b0eeabcb7 100644 --- a/src/logging.h +++ b/src/logging.h @@ -262,9 +262,6 @@ inline void LogPrintFormatInternal(std::string_view logging_function, std::strin #define LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Warning, __VA_ARGS__) #define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__) -// Deprecated unconditional logging. -#define LogPrintf(...) LogInfo(__VA_ARGS__) - // Use a macro instead of a function for conditional logging to prevent // evaluating arguments when logging for the category is not enabled. diff --git a/src/test/logging_tests.cpp b/src/test/logging_tests.cpp index 918969ec531..93e858272cf 100644 --- a/src/test/logging_tests.cpp +++ b/src/test/logging_tests.cpp @@ -110,7 +110,6 @@ BOOST_FIXTURE_TEST_CASE(logging_LogPrintStr, LogSetup) BOOST_FIXTURE_TEST_CASE(logging_LogPrintMacrosDeprecated, LogSetup) { - LogInfo("foo5: %s\n", "bar5"); LogPrintLevel(BCLog::NET, BCLog::Level::Trace, "foo4: %s\n", "bar4"); // not logged LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "foo7: %s\n", "bar7"); LogPrintLevel(BCLog::NET, BCLog::Level::Info, "foo8: %s\n", "bar8"); @@ -122,7 +121,6 @@ BOOST_FIXTURE_TEST_CASE(logging_LogPrintMacrosDeprecated, LogSetup) log_lines.push_back(log); } std::vector expected = { - "foo5: bar5", "[net] foo7: bar7", "[net:info] foo8: bar8", "[net:warning] foo9: bar9",