util/log: Rename LogPrintLevel_ into detail_ namespace
What changed, and why it matters
This is a simple code cleanup change that renames an internal logging helper macro from LogPrintLevel_ to detail_LogWithSrcLoc. The macro does exactly the same thing as before; only its name changed. There is no security issue here.
No action needed. This is a non-security refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit renames the internal macro LogPrintLevel_ to detail_LogWithSrcLoc and updates all call sites in src/util/log.h. The macro still expands to util::log::LogPrintFormatInternal with the same arguments. This is a pure refactoring with no functional or security changes.
Changed components
src/util/log.hInspect captured patch +5 / −5
diff --git a/src/util/log.h b/src/util/log.h
index 64df6373..c9b70c9d 100644
--- a/src/util/log.h
+++ b/src/util/log.h
@@ -112,15 +112,15 @@ using Level = util::log::Level;
// Allow __func__ to be used in any context without warnings:
// NOLINTNEXTLINE(bugprone-lambda-function-name)
-#define LogPrintLevel_(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
+#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
// Log unconditionally. Uses basic rate limiting to mitigate disk filling attacks.
// Be conservative when using functions that unconditionally log to debug.log!
// It should not be the case that an inbound peer can fill up a user's storage
// with debug.log entries.
-#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
-#define LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, util::log::Level::Warning, __VA_ARGS__)
-#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
+#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
+#define LogWarning(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Warning, __VA_ARGS__)
+#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
// Use a macro instead of a function for conditional logging to prevent
// evaluating arguments when logging for the category is not enabled.
@@ -132,7 +132,7 @@ using Level = util::log::Level;
do { \
if (util::log::ShouldLog((category), (level))) { \
Assume((level) < util::log::Level::Info); /*Only called with the levels below*/ \
- LogPrintLevel_((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
+ detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
} \
} while (0)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.