Skip to content

Commit 1377c86

Browse files
committed
Set module name in json
Signed-off-by: JCW <[email protected]>
1 parent c966f8b commit 1377c86

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/xrpl/beast/utility/Journal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ class Journal
337337
reset(
338338
std::source_location location,
339339
severities::Severity severity,
340+
std::string_view moduleName,
340341
std::string_view journalAttributesJson) noexcept;
341342
};
342343

src/libxrpl/beast/utility/beast_Journal.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void
125125
Journal::JsonLogContext::reset(
126126
std::source_location location,
127127
severities::Severity severity,
128+
std::string_view moduleName,
128129
std::string_view journalAttributesJson) noexcept
129130
{
130131
struct ThreadIdStringInitializer
@@ -161,6 +162,8 @@ Journal::JsonLogContext::reset(
161162
}
162163
}
163164

165+
writer().writeKey("ModuleName");
166+
writer().writeString(moduleName);
164167
writer().writeKey("MessageParams");
165168
writer().startObject();
166169

@@ -191,7 +194,7 @@ Journal::initMessageContext(
191194
std::source_location location,
192195
severities::Severity severity) const
193196
{
194-
currentJsonLogContext_.reset(location, severity, m_attributesJson);
197+
currentJsonLogContext_.reset(location, severity, m_name, m_attributesJson);
195198
}
196199

197200
std::string_view

0 commit comments

Comments
 (0)