diff options
Diffstat (limited to 'src/mongo/db/matcher/rewrite_expr.cpp')
-rw-r--r-- | src/mongo/db/matcher/rewrite_expr.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mongo/db/matcher/rewrite_expr.cpp b/src/mongo/db/matcher/rewrite_expr.cpp index 01e5a6e51c5..31dfcfd51ee 100644 --- a/src/mongo/db/matcher/rewrite_expr.cpp +++ b/src/mongo/db/matcher/rewrite_expr.cpp @@ -36,6 +36,7 @@ #include "mongo/db/matcher/expression_internal_expr_eq.h" #include "mongo/db/matcher/expression_leaf.h" #include "mongo/db/matcher/expression_tree.h" +#include "mongo/logv2/log.h" #include "mongo/util/log.h" namespace mongo { @@ -44,16 +45,25 @@ using CmpOp = ExpressionCompare::CmpOp; RewriteExpr::RewriteResult RewriteExpr::rewrite(const boost::intrusive_ptr<Expression>& expression, const CollatorInterface* collator) { - LOG(5) << "Expression prior to rewrite: " << expression->serialize(false); + LOGV2_DEBUG(20725, + 5, + "Expression prior to rewrite: {expression_serialize_false}", + "expression_serialize_false"_attr = expression->serialize(false)); RewriteExpr rewriteExpr(collator); std::unique_ptr<MatchExpression> matchExpression; if (auto matchTree = rewriteExpr._rewriteExpression(expression)) { matchExpression = std::move(matchTree); - LOG(5) << "Post-rewrite MatchExpression: " << matchExpression->debugString(); + LOGV2_DEBUG(20726, + 5, + "Post-rewrite MatchExpression: {matchExpression_debugString}", + "matchExpression_debugString"_attr = matchExpression->debugString()); matchExpression = MatchExpression::optimize(std::move(matchExpression)); - LOG(5) << "Post-rewrite/post-optimized MatchExpression: " << matchExpression->debugString(); + LOGV2_DEBUG(20727, + 5, + "Post-rewrite/post-optimized MatchExpression: {matchExpression_debugString}", + "matchExpression_debugString"_attr = matchExpression->debugString()); } return {std::move(matchExpression), std::move(rewriteExpr._matchExprElemStorage)}; |