Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Monolog/Handler/AbstractProcessingHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function handle(LogRecord $record): bool

$this->write($record);

return false === $this->bubble;
return !$this->getBubble();
}

/**
Expand Down
18 changes: 18 additions & 0 deletions tests/Monolog/Handler/AbstractProcessingHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Monolog\Handler;

use Monolog\Level;
use Monolog\LogRecord;
use Monolog\Processor\WebProcessor;
use Monolog\Formatter\LineFormatter;

Expand Down Expand Up @@ -89,6 +90,23 @@ public function testProcessRecord()
$this->assertEquals(6, \count($handledRecord['extra']));
}

/**
* @covers Monolog\Handler\AbstractProcessingHandler::handle
*/
public function testHandleRespectsGetBubbleOverride(): void
{
$handler = new class(Level::Debug, false) extends AbstractProcessingHandler {
protected function write(LogRecord $record): void {}

public function getBubble(): bool
{
return true;
}
};

$this->assertFalse($handler->handle($this->getRecord()));
}

/**
* @covers Monolog\Handler\ProcessableHandlerTrait::pushProcessor
* @covers Monolog\Handler\ProcessableHandlerTrait::popProcessor
Expand Down