diff --git a/collector/lib/Utility.cpp b/collector/lib/Utility.cpp index deb98e4364..92f0a0b03a 100644 --- a/collector/lib/Utility.cpp +++ b/collector/lib/Utility.cpp @@ -254,6 +254,11 @@ std::optional SanitizedUTF8(std::string_view str) { void LogProtobufMessage(const google::protobuf::Message& msg) { using namespace google::protobuf::util; + + if (!logging::CheckLogLevel(logging::LogLevel::DEBUG)) { + return; + } + std::string output; absl::Status status = MessageToJsonString(msg, &output, JsonPrintOptions{}); if (status.ok()) {