From 639ccf7ddc7c598a2fc80898e6347585755acab8 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 16 Sep 2015 15:16:04 -0300 Subject: [PATCH] Fix the rule execution debug log, so that tests won't complain --- src/rule.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/rule.cc b/src/rule.cc index 17e385f1..c95b4c2a 100644 --- a/src/rule.cc +++ b/src/rule.cc @@ -196,11 +196,19 @@ bool Rule::evaluate(Assay *assay) { return evaluateActions(assay); } + std::string eparam = MacroExpansion::expand(this->op->param, assay); + + if (this->op->param != eparam) { + eparam = "\"" + eparam + "\" Was: \"" + this->op->param + "\""; + } else { + eparam = "\"" + eparam + "\""; + } + assay->debug(4, "(Rule: " + std::to_string(rule_id) \ + ") Executing operator \"" + this->op->op \ - + "\" with param: " \ - + MacroExpansion::expandKeepOriginal(this->op->param, assay) \ - + ", against " \ + + "\" with param " \ + + eparam \ + + " against " \ + Variable::to_s(variables) + "."); clock_t begin = clock();