mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
committed by
GitHub
parent
b05bf55097
commit
06276fcf77
@@ -181,9 +181,8 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa
|
||||
private function flushBuffer(): void
|
||||
{
|
||||
if (null !== $this->passthruLevel) {
|
||||
$level = $this->passthruLevel;
|
||||
$this->buffer = array_filter($this->buffer, function ($record) use ($level) {
|
||||
return $record->level >= $level;
|
||||
$this->buffer = array_filter($this->buffer, function ($record) {
|
||||
return $this->passthruLevel->includes($record->level);
|
||||
});
|
||||
if (count($this->buffer) > 0) {
|
||||
$this->getHandler(end($this->buffer))->handleBatch($this->buffer);
|
||||
|
@@ -259,9 +259,11 @@ class FingersCrossedHandlerTest extends TestCase
|
||||
$handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Level::Warning), 0, true, true, Level::Info);
|
||||
$handler->handle($this->getRecord(Level::Debug));
|
||||
$handler->handle($this->getRecord(Level::Info));
|
||||
$handler->handle($this->getRecord(Level::Notice));
|
||||
$handler->close();
|
||||
$this->assertFalse($test->hasDebugRecords());
|
||||
$this->assertTrue($test->hasInfoRecords());
|
||||
$this->assertTrue($test->hasNoticeRecords());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,8 +275,10 @@ class FingersCrossedHandlerTest extends TestCase
|
||||
$handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Level::Warning), 0, true, true, LogLevel::INFO);
|
||||
$handler->handle($this->getRecord(Level::Debug));
|
||||
$handler->handle($this->getRecord(Level::Info));
|
||||
$handler->handle($this->getRecord(Level::Notice));
|
||||
$handler->close();
|
||||
$this->assertFalse($test->hasDebugRecords());
|
||||
$this->assertTrue($test->hasInfoRecords());
|
||||
$this->assertTrue($test->hasNoticeRecords());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user