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
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -288,9 +288,12 @@ bool Rule::executeOperatorAt(Transaction *trans, std::string key,
bool ret;
#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)) \
+ "\" (Variable: " + key + ")");
}
#endif
ret = this->m_op->evaluateInternal(trans, this, value, ruleMessage);