Skip to content

Commit 2ba788d

Browse files
author
Felipe Zimmerle
committed
perf improvement: Checks debuglog level before format debug msg
1 parent a037726 commit 2ba788d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rule.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,12 @@ bool Rule::executeOperatorAt(Transaction *trans, std::string key,
288288
bool ret;
289289

290290
#ifndef NO_LOGS
291-
trans->debug(9, "Target value: \"" + utils::string::limitTo(80,
291+
if (trans && trans->m_rules && trans->m_rules->m_debugLog
292+
&& trans->m_rules->m_debugLog->getDebugLogLevel() >= 9) {
293+
trans->debug(9, "Target value: \"" + utils::string::limitTo(80,
292294
utils::string::toHexIfNeeded(value)) \
293295
+ "\" (Variable: " + key + ")");
296+
}
294297
#endif
295298

296299
ret = this->m_op->evaluateInternal(trans, this, value, ruleMessage);

0 commit comments

Comments
 (0)