fix: use short debug string to avoid newline in debug logs (#44929)

issue: #44924
pr: #44925

Signed-off-by: chyezh <chyezh@outlook.com>
This commit is contained in:
Zhen Ye 2025-10-20 10:32:03 +08:00 committed by GitHub
parent 82c019181e
commit 1ff0d5d47d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 14 deletions

View File

@ -252,7 +252,7 @@ GetValueFromProtoInternal(const milvus::proto::plan::GenericValue& value_proto,
} else { } else {
ThrowInfo(Unsupported, ThrowInfo(Unsupported,
"unsupported generic value {}", "unsupported generic value {}",
value_proto.DebugString()); value_proto.ShortDebugString());
} }
} }

View File

@ -360,7 +360,7 @@ class ValueExpr : public ITypeExpr {
ToString() const override { ToString() const override {
std::stringstream ss; std::stringstream ss;
ss << "ValueExpr: {" ss << "ValueExpr: {"
<< " val:" << val_.DebugString() << "}"; << " val:" << val_.ShortDebugString() << "}";
return ss.str(); return ss.str();
} }
@ -393,10 +393,10 @@ class UnaryRangeFilterExpr : public ITypeFilterExpr {
std::stringstream ss; std::stringstream ss;
ss << "UnaryRangeFilterExpr: {columnInfo:" << column_.ToString() ss << "UnaryRangeFilterExpr: {columnInfo:" << column_.ToString()
<< " op_type:" << milvus::proto::plan::OpType_Name(op_type_) << " op_type:" << milvus::proto::plan::OpType_Name(op_type_)
<< " val:" << val_.DebugString() << " extra_values: ["; << " val:" << val_.ShortDebugString() << " extra_values: [";
for (size_t i = 0; i < extra_values_.size(); i++) { for (size_t i = 0; i < extra_values_.size(); i++) {
ss << extra_values_[i].DebugString(); ss << extra_values_[i].ShortDebugString();
if (i != extra_values_.size() - 1) { if (i != extra_values_.size() - 1) {
ss << ", "; ss << ", ";
} }
@ -518,7 +518,7 @@ class TermFilterExpr : public ITypeFilterExpr {
std::string values; std::string values;
for (const auto& val : vals_) { for (const auto& val : vals_) {
values += val.DebugString() + ", "; values += val.ShortDebugString() + ", ";
} }
std::stringstream ss; std::stringstream ss;
@ -615,8 +615,8 @@ class BinaryRangeFilterExpr : public ITypeFilterExpr {
ToString() const override { ToString() const override {
std::stringstream ss; std::stringstream ss;
ss << "BinaryRangeFilterExpr:[Column: " << column_.ToString() ss << "BinaryRangeFilterExpr:[Column: " << column_.ToString()
<< ", Lower Value: " << lower_val_.DebugString() << ", Lower Value: " << lower_val_.ShortDebugString()
<< ", Upper Value: " << upper_val_.DebugString() << ", Upper Value: " << upper_val_.ShortDebugString()
<< ", Lower Inclusive: " << (lower_inclusive_ ? "true" : "false") << ", Lower Inclusive: " << (lower_inclusive_ ? "true" : "false")
<< ", Upper Inclusive: " << (upper_inclusive_ ? "true" : "false") << ", Upper Inclusive: " << (upper_inclusive_ ? "true" : "false")
<< "]"; << "]";
@ -660,8 +660,8 @@ class BinaryArithOpEvalRangeExpr : public ITypeFilterExpr {
<< ", Operator Type: " << milvus::proto::plan::OpType_Name(op_type_) << ", Operator Type: " << milvus::proto::plan::OpType_Name(op_type_)
<< ", Arith Operator Type: " << ", Arith Operator Type: "
<< milvus::proto::plan::ArithOpType_Name(arith_op_type_) << milvus::proto::plan::ArithOpType_Name(arith_op_type_)
<< ", Value: " << value_.DebugString() << ", Value: " << value_.ShortDebugString()
<< ", Right Operand: " << right_operand_.DebugString() << "]"; << ", Right Operand: " << right_operand_.ShortDebugString() << "]";
return ss.str(); return ss.str();
} }
@ -694,9 +694,9 @@ class TimestamptzArithCompareExpr : public ITypeFilterExpr {
ss << "TimestamptzArithCompareExpr:[Column: " ss << "TimestamptzArithCompareExpr:[Column: "
<< timestamp_column_.ToString() << timestamp_column_.ToString()
<< ", ArithOp: " << milvus::proto::plan::ArithOpType_Name(arith_op_) << ", ArithOp: " << milvus::proto::plan::ArithOpType_Name(arith_op_)
<< ", Interval: " << interval_.DebugString() << ", Interval: " << interval_.ShortDebugString()
<< ", CompareOp: " << milvus::proto::plan::OpType_Name(compare_op_) << ", CompareOp: " << milvus::proto::plan::OpType_Name(compare_op_)
<< ", CompareValue: " << compare_value_.DebugString() << "]"; << ", CompareValue: " << compare_value_.ShortDebugString() << "]";
return ss.str(); return ss.str();
} }
@ -857,7 +857,7 @@ class JsonContainsExpr : public ITypeFilterExpr {
ToString() const override { ToString() const override {
std::string values; std::string values;
for (const auto& val : vals_) { for (const auto& val : vals_) {
values += val.DebugString() + ", "; values += val.ShortDebugString() + ", ";
} }
return fmt::format( return fmt::format(
"JsonContainsExpr:[Column: {}, Operator: {}, Same Type: {}, " "JsonContainsExpr:[Column: {}, Operator: {}, Same Type: {}, "

View File

@ -321,7 +321,7 @@ ProtoParser::RetrievePlanNodeFromProto(
std::unique_ptr<Plan> std::unique_ptr<Plan>
ProtoParser::CreatePlan(const proto::plan::PlanNode& plan_node_proto) { ProtoParser::CreatePlan(const proto::plan::PlanNode& plan_node_proto) {
LOG_DEBUG("create search plan from proto: {}", LOG_DEBUG("create search plan from proto: {}",
plan_node_proto.DebugString()); plan_node_proto.ShortDebugString());
auto plan = std::make_unique<Plan>(schema); auto plan = std::make_unique<Plan>(schema);
auto plan_node = PlanNodeFromProto(plan_node_proto); auto plan_node = PlanNodeFromProto(plan_node_proto);
@ -345,7 +345,7 @@ ProtoParser::CreatePlan(const proto::plan::PlanNode& plan_node_proto) {
std::unique_ptr<RetrievePlan> std::unique_ptr<RetrievePlan>
ProtoParser::CreateRetrievePlan(const proto::plan::PlanNode& plan_node_proto) { ProtoParser::CreateRetrievePlan(const proto::plan::PlanNode& plan_node_proto) {
LOG_DEBUG("create retrieve plan from proto: {}", LOG_DEBUG("create retrieve plan from proto: {}",
plan_node_proto.DebugString()); plan_node_proto.ShortDebugString());
auto retrieve_plan = std::make_unique<RetrievePlan>(schema); auto retrieve_plan = std::make_unique<RetrievePlan>(schema);
auto plan_node = RetrievePlanNodeFromProto(plan_node_proto); auto plan_node = RetrievePlanNodeFromProto(plan_node_proto);