perf improvement: Checks debuglog level before format debug msg

This commit is contained in:
Felipe Zimmerle
2018-01-02 22:58:50 -03:00
parent a037726308
commit 2ba788d2d7

View File

@@ -288,9 +288,12 @@ bool Rule::executeOperatorAt(Transaction *trans, std::string key,
bool ret; bool ret;
#ifndef NO_LOGS #ifndef NO_LOGS
trans->debug(9, "Target value: \"" + utils::string::limitTo(80, if (trans && trans->m_rules && trans->m_rules->m_debugLog
&& trans->m_rules->m_debugLog->getDebugLogLevel() >= 9) {
trans->debug(9, "Target value: \"" + utils::string::limitTo(80,
utils::string::toHexIfNeeded(value)) \ utils::string::toHexIfNeeded(value)) \
+ "\" (Variable: " + key + ")"); + "\" (Variable: " + key + ")");
}
#endif #endif
ret = this->m_op->evaluateInternal(trans, this, value, ruleMessage); ret = this->m_op->evaluateInternal(trans, this, value, ruleMessage);