MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / OssLog

Method OssLog

src/plugin/log/src/AFCLogModule.cpp:127–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void AFCLogModule::OssLog(const google::protobuf::Message& msg)
128{
129 const std::string& logger_name = msg.GetDescriptor()->name();
130 auto iter = oss_loggers_.find(logger_name);
131 spdlogger logger;
132 if (iter == oss_loggers_.end())
133 {
134 logger = CreateOssLogger(logger_name);
135 }
136 else
137 {
138 logger = iter->second;
139 }
140
141 google::protobuf::util::JsonOptions option;
142 option.add_whitespace = false;
143 option.always_print_primitive_fields = true;
144 option.always_print_enums_as_ints = true;
145 option.preserve_proto_field_names = true;
146
147 std::string pb_json;
148 google::protobuf::util::MessageToJsonString(msg, &pb_json, option);
149 logger->log(spdlog::level::info, pb_json);
150}
151
152} // namespace ark

Callers

nothing calls this directly

Calls 3

nameMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected