ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
This simple wrapper class can be used to extend handlers functionality. More...
Public Member Functions | ||||
__construct (HandlerInterface $handler) | ||||
HandlerWrapper constructor. More... | ||||
isHandling (array $record) | ||||
{Checks whether the given record will be handled by this handler.This is mostly done for performance reasons, to avoid calling processors for nothing.Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.
| ||||
handle (array $record) | ||||
{Handles a record.All records may be passed to this method, and the handler should discard those that it does not want to handle.The return value of this function controls the bubbling process of the handler stack. Unless the bubbling is interrupted (by returning true), the Logger class will keep on calling further handlers in the stack with a given log record.
| ||||
handleBatch (array $records) | ||||
{Handles a set of records at once.
| ||||
pushProcessor ($callback) | ||||
{Adds a processor in the stack.
| ||||
popProcessor () | ||||
{Removes the processor on top of the stack and returns it.
| ||||
setFormatter (FormatterInterface $formatter) | ||||
{Sets the formatter.
| ||||
getFormatter () | ||||
{Gets the formatter.
| ||||
Protected Attributes | |
$handler | |
This simple wrapper class can be used to extend handlers functionality.
Example: A filtering handle. Inherit from this class, override isHandling() like this
public function isHandling(array $record) { if ($record meets certain conditions) { return false; } return $this->handler->isHandling($record); }
Definition at line 31 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::__construct | ( | HandlerInterface | $handler | ) |
HandlerWrapper constructor.
HandlerInterface | $handler |
Definition at line 42 of file HandlerWrapper.php.
References Monolog\Handler\HandlerWrapper\$handler.
Monolog\Handler\HandlerWrapper::getFormatter | ( | ) |
{Gets the formatter.
Implements Monolog\Handler\HandlerInterface.
Definition at line 102 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::handle | ( | array | $record | ) |
{Handles a record.All records may be passed to this method, and the handler should discard those that it does not want to handle.The return value of this function controls the bubbling process of the handler stack. Unless the bubbling is interrupted (by returning true), the Logger class will keep on calling further handlers in the stack with a given log record.
array | $record | The record to handle |
Implements Monolog\Handler\HandlerInterface.
Definition at line 58 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::handleBatch | ( | array | $records | ) |
{Handles a set of records at once.
array | $records | The records to handle (an array of record arrays) |
Implements Monolog\Handler\HandlerInterface.
Definition at line 66 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::isHandling | ( | array | $record | ) |
{Checks whether the given record will be handled by this handler.This is mostly done for performance reasons, to avoid calling processors for nothing.Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.
array | $record | Partial log record containing only a level key |
Implements Monolog\Handler\HandlerInterface.
Definition at line 50 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::popProcessor | ( | ) |
{Removes the processor on top of the stack and returns it.
Implements Monolog\Handler\HandlerInterface.
Definition at line 84 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::pushProcessor | ( | $callback | ) |
{Adds a processor in the stack.
callable | $callback |
Implements Monolog\Handler\HandlerInterface.
Definition at line 74 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::setFormatter | ( | FormatterInterface | $formatter | ) |
{Sets the formatter.
FormatterInterface | $formatter |
Implements Monolog\Handler\HandlerInterface.
Definition at line 92 of file HandlerWrapper.php.
|
protected |
Definition at line 36 of file HandlerWrapper.php.
Referenced by Monolog\Handler\HandlerWrapper\__construct().