From 719bec8636f2a5b3c19c6c7aabb58f391b28bdfe Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 24 Mar 2023 17:46:14 +0000 Subject: Marginally improve the performance of JSON logging. --- src/modules/extra/m_log_json.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/extra/m_log_json.cpp b/src/modules/extra/m_log_json.cpp index 4b401be92..820f7f161 100644 --- a/src/modules/extra/m_log_json.cpp +++ b/src/modules/extra/m_log_json.cpp @@ -81,17 +81,17 @@ public: rapidjson::Writer writer(*this); writer.StartObject(); { - writer.Key("time"); + writer.Key("time", 4); writer.String(timestr.c_str(), static_cast(timestr.size())); - writer.Key("type"); + writer.Key("type", 4); writer.String(type.c_str(), static_cast(type.size())); - writer.Key("level"); + writer.Key("level", 5); const std::string levelstr = Log::LevelToString(level); writer.String(levelstr.c_str(), static_cast(levelstr.size())); - writer.Key("message"); + writer.Key("message", 7); writer.Key(message.c_str(), static_cast(message.size())); } writer.EndObject(); -- cgit v1.3.1-10-gc9f91