interface Horde_Log_Filter
{
/**
- * Returns TRUE to accept the message, FALSE to block it.
+ * Accept a message
+ */
+ const ACCEPT = true;
+
+ /**
+ * Filter out a message
+ */
+ const IGNORE = false;
+
+ /**
+ * Returns Horde_Log_Filter::ACCEPT to accept the message,
+ * Horde_Log_Filter::IGNORE to ignore it.
*
* @param array $event Log event
* @return boolean accepted?
}
/**
- * Returns TRUE to accept the message, FALSE to block it.
+ * Returns Horde_Log_Filter::ACCEPT to accept the message,
+ * Horde_Log_Filter::IGNORE to ignore it.
*
* @param array $event Log event
* @return boolean accepted?
foreach ($this->_constraints as $field => $constraint) {
$value = isset($event[$field]) ? $event[$field] : null;
if (!$constraint->evaluate($value)) {
- return false;
+ return Horde_Log_Filter::IGNORE;
}
}
- return true;
+ return Horde_Log_Filter::ACCEPT;
}
}
}
/**
- * Returns TRUE to accept the message, FALSE to block it.
+ * Returns Horde_Log_Filter::ACCEPT to accept the message,
+ * Horde_Log_Filter::IGNORE to ignore it.
*
* @param array $event Log event
* @return boolean accepted?
}
/**
- * Returns TRUE to accept the message, FALSE to block it.
+ * Returns Horde_Log_Filter::ACCEPT to accept the message,
+ * Horde_Log_Filter::IGNORE to ignore it.
*
* @param array $event Log event
* @return boolean accepted?
/**
* @var boolean
*/
- protected $_accept = true;
+ protected $_accept = Horde_Log_Filter::ACCEPT;
/**
* This is a simple boolean filter.
}
/**
- * Returns TRUE to accept the message, FALSE to block it.
+ * Returns Horde_Log_Filter::ACCEPT to accept the message,
+ * Horde_Log_Filter::IGNORE to ignore it.
*
* @param array $event event data
* @return boolean accepted?