silverstripe-fulltextsearch/tests/SolrReindexTest/SolrReindexTest_Handler.php

41 lines
750 B
PHP
Raw Normal View History

<?php
namespace SilverStripe\FullTextSearch\Tests\SolrReindexTest;
use Monolog\Handler\AbstractProcessingHandler;
2022-12-12 03:22:01 +01:00
use Monolog\LogRecord;
use SilverStripe\Dev\TestOnly;
/**
* Logger for recording messages for later retrieval
*/
class SolrReindexTest_Handler extends AbstractProcessingHandler implements TestOnly
{
/**
* Messages
*
* @var array
*/
protected $messages = array();
/**
* Get all messages
*
* @return array
*/
public function getMessages()
{
return $this->messages;
}
public function clear()
{
$this->messages = array();
}
2022-12-12 03:22:01 +01:00
protected function write(LogRecord $record): void
{
$this->messages[] = $record['message'];
}
}