Skip to content

Commit 1b5a958

Browse files
committed
Support structured logs
Signed-off-by: JCW <[email protected]>
1 parent 9d893e1 commit 1b5a958

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libxrpl/logging/JsonLogs.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
*/
1818
//==============================================================================
1919

20-
#include <xrpl/logging/JsonLogs.h>
20+
#include <xrpl/telemetry/JsonLogs.h>
21+
#include <xrpl/json/to_string.h>
22+
2123
namespace ripple {
2224
namespace log {
2325

@@ -100,14 +102,14 @@ JsonStructuredJournal::Logger::write(
100102
threadIdStream << std::this_thread::get_id();
101103
globalContext["ThreadId"] = threadIdStream.str();
102104
globalContext["Params"] = messageParams;
103-
globalContext["Level"] = Logs::toString(Logs::fromSeverity(level));
105+
globalContext["Level"] = beast::severities::to_string(level);
104106
globalContext["Message"] = text;
105107
globalContext["Time"] =
106108
to_string(std::chrono::duration_cast<std::chrono::milliseconds>(
107109
std::chrono::system_clock::now().time_since_epoch())
108110
.count());
109111

110-
sink->write(level, Json::jsonAsString(globalContext));
112+
sink->write(level, to_string(globalContext));
111113
}
112114

113115
JsonStructuredJournal::Logger

0 commit comments

Comments
 (0)