util: add timestamp and thread_name to log::Entry
What changed, and why it matters
This commit adds two pieces of metadata to each log entry: the time it was created and the name of the thread that created it. It is a straightforward internal logging improvement with no apparent security relevance.
No security action required. Review as a normal logging enhancement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch extends the log::Entry struct in src/util/log.h by adding a SystemClock::time_point timestamp initialized to SystemClock::now() and a std::string thread_name initialized to util::ThreadGetInternalName(). It also adds the corresponding #include directives for util/threadnames.h and util/time.h. The change is additive and does not alter control flow, network behavior, validation logic, or cryptographic handling.
Changed components
src/util/log.hInspect captured patch +4 / −0
diff --git a/src/util/log.h b/src/util/log.h
index 641b81ff..38214f96 100644
--- a/src/util/log.h
+++ b/src/util/log.h
@@ -10,6 +10,8 @@
#include <logging/categories.h> // IWYU pragma: export
#include <tinyformat.h>
#include <util/check.h>
+#include <util/threadnames.h>
+#include <util/time.h>
#include <cstdint>
#include <source_location>
@@ -53,6 +55,8 @@ struct Entry {
Category category;
Level level;
bool should_ratelimit{false}; //!< Hint for consumers if this entry should be ratelimited
+ SystemClock::time_point timestamp{SystemClock::now()};
+ std::string thread_name{util::ThreadGetInternalName()};
SourceLocation source_loc;
std::string message;
};
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.