Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Protected Attributes
Zend_Log_Filter_Message Class Reference
Inheritance diagram for Zend_Log_Filter_Message:
Zend_Log_Filter_Abstract Zend_Log_Filter_Interface Zend_Log_FactoryInterface

Public Member Functions

 __construct ($regexp)
 
 accept ($event)
 

Static Public Member Functions

static factory ($config)
 

Protected Attributes

 $_regexp
 

Additional Inherited Members

- Static Protected Member Functions inherited from Zend_Log_Filter_Abstract
static _parseConfig ($config)
 

Detailed Description

Definition at line 34 of file Message.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $regexp)

Filter out any log messages not matching $regexp.

Parameters
string$regexpRegular expression to test the log message
Returns
void
Exceptions
Zend_Log_Exception

Definition at line 48 of file Message.php.

49  {
50  if (@preg_match($regexp, '') === false) {
51  #require_once 'Zend/Log/Exception.php';
52  throw new Zend_Log_Exception("Invalid regular expression '$regexp'");
53  }
54  $this->_regexp = $regexp;
55  }

Member Function Documentation

◆ accept()

accept (   $event)

Returns TRUE to accept the message, FALSE to block it.

Parameters
array$eventevent data
Returns
boolean accepted?

Implements Zend_Log_Filter_Interface.

Definition at line 81 of file Message.php.

82  {
83  return preg_match($this->_regexp, $event['message']) > 0;
84  }

◆ factory()

static factory (   $config)
static

Create a new instance of Zend_Log_Filter_Message

Parameters
array | Zend_Config$config
Returns
Zend_Log_Filter_Message

Implements Zend_Log_FactoryInterface.

Definition at line 63 of file Message.php.

64  {
66  $config = array_merge(array(
67  'regexp' => null
68  ), $config);
69 
70  return new self(
71  $config['regexp']
72  );
73  }
$config
Definition: fraud_order.php:17
static _parseConfig($config)
Definition: Abstract.php:47

Field Documentation

◆ $_regexp

$_regexp
protected

Definition at line 39 of file Message.php.


The documentation for this class was generated from the following file: