Fix test cases

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2025-09-10 12:02:00 +01:00
parent 893632d330
commit c4047690e2
2 changed files with 7 additions and 2 deletions

View File

@@ -658,7 +658,10 @@ public:
std::string buffer;
buffer.reserve(128);
detail::SimpleJsonWriter writer{buffer};
writer.startObject();
if (jsonLogsEnabled_)
{
writer.startObject();
}
attributesFactory(writer);
attributes_ = std::move(buffer);
}

View File

@@ -375,9 +375,11 @@ class JsonLogStreamFixture
public:
JsonLogStreamFixture()
: sink_(beast::severities::kAll, logStream_)
, j_(sink_, "Test", log::attributes(log::attr("Field1", "Value1")))
, j_(beast::Journal::getNullSink())
{
beast::Journal::resetGlobalAttributes();
beast::Journal::enableStructuredJournal();
j_ = beast::Journal{sink_, "Test", log::attributes(log::attr("Field1", "Value1"))};
}
~JsonLogStreamFixture()