1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-09 14:46:46 +02:00

Adds FingersCrossedHandler::clear and BufferHandler::clear, fixes #390

This commit is contained in:
Jordi Boggiano
2014-07-28 20:45:50 +02:00
parent 6397b5883b
commit 55b60344a8
2 changed files with 21 additions and 2 deletions

View File

@@ -88,8 +88,7 @@ class BufferHandler extends AbstractHandler
}
$this->handler->handleBatch($this->buffer);
$this->bufferSize = 0;
$this->buffer = array();
$this->clear();
}
/**
@@ -99,4 +98,13 @@ class BufferHandler extends AbstractHandler
{
$this->flush();
}
/**
* Clears the buffer without flushing any messages down to the wrapped handler.
*/
public function clear()
{
$this->bufferSize = 0;
$this->buffer = array();
}
}

View File

@@ -135,4 +135,15 @@ class FingersCrossedHandler extends AbstractHandler
{
$this->buffering = true;
}
/**
* Clears the buffer without flushing any messages down to the wrapped handler.
*
* It also resets the handler to its initial buffering state.
*/
public function clear()
{
$this->buffer = array();
$this->reset();
}
}