summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2019-03-20 17:18:56 -0400
committerDavid Storch <david.storch@10gen.com>2019-03-22 16:23:15 -0400
commit60c0441f9ba3196eaabe38935333d17f1aff88f8 (patch)
treeedf0c9d697406fa2830057699f81e233e076b0bd /src/mongo/db/matcher/expression.h
parent7863f89c67dc4fa50330e585b5a4310daa0f42dc (diff)
downloadmongo-60c0441f9ba3196eaabe38935333d17f1aff88f8.tar.gz
SERVER-40267 Clean up debug string generation for MatchExpression.
Diffstat (limited to 'src/mongo/db/matcher/expression.h')
-rw-r--r--src/mongo/db/matcher/expression.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mongo/db/matcher/expression.h b/src/mongo/db/matcher/expression.h
index 0fb0a2060b4..9607dce1963 100644
--- a/src/mongo/db/matcher/expression.h
+++ b/src/mongo/db/matcher/expression.h
@@ -309,8 +309,20 @@ public:
//
// Debug information
//
- virtual std::string toString() const;
- virtual void debugString(StringBuilder& debug, int level = 0) const = 0;
+
+ /**
+ * Returns a debug string representing the match expression tree, including any tags attached
+ * for planning. This debug string format may spill across multiple lines, so it is not suitable
+ * for logging at low debug levels or for error messages.
+ */
+ std::string debugString() const;
+ virtual void debugString(StringBuilder& debug, int indentationLevel = 0) const = 0;
+
+ /**
+ * Serializes this MatchExpression to BSON, and then returns a standard string representation of
+ * the resulting BSON object.
+ */
+ std::string toString() const;
protected:
/**
@@ -330,7 +342,7 @@ protected:
virtual void _doAddDependencies(DepsTracker* deps) const {}
- void _debugAddSpace(StringBuilder& debug, int level) const;
+ void _debugAddSpace(StringBuilder& debug, int indentationLevel) const;
private:
/**