szaszm commented on code in PR #1670: URL: https://github.com/apache/nifi-minifi-cpp/pull/1670#discussion_r1342962956
########## libminifi/src/c2/C2Agent.cpp: ########## @@ -151,16 +151,16 @@ void C2Agent::configure(const std::shared_ptr<Configure> &configure, bool reconf if (!configure->get(Configuration::nifi_c2_agent_protocol_class, "c2.agent.protocol.class", clazz)) { clazz = "RESTSender"; } - logger_->log_info("Class is %s", clazz); + logger_->log_info("Class is {}", clazz); auto protocol = core::ClassLoader::getDefaultClassLoader().instantiateRaw(clazz, clazz); if (protocol == nullptr) { - logger_->log_warn("Class %s not found", clazz); + logger_->log_warn("Class {} not found", clazz); protocol = core::ClassLoader::getDefaultClassLoader().instantiateRaw("RESTSender", "RESTSender"); if (!protocol) { - const char* errmsg = "Attempted to load RESTSender. To enable C2, please specify an active protocol for this agent."; - logger_->log_error(errmsg); - throw Exception{ GENERAL_EXCEPTION, errmsg }; + constexpr std::string_view errmsg = "Attempted to load RESTSender. To enable C2, please specify an active protocol for this agent."; + logger_->log_error("{}", errmsg); + throw Exception{ GENERAL_EXCEPTION, std::string(errmsg) }; Review Comment: I'd prefer the `const char*` constructor, that doesn't result in an extra temporary allocation. ```suggestion throw Exception{ GENERAL_EXCEPTION, errmsg.data() }; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org