You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
487 B
24 lines
487 B
7 years ago
|
<?php
|
||
|
|
||
|
namespace yiiunit\framework\log;
|
||
|
|
||
|
use yii\base\Exception;
|
||
|
use yii\log\Target;
|
||
|
|
||
|
/**
|
||
|
* ArrayTarget logs messages into an array, useful for tracking data in tests.
|
||
|
*/
|
||
|
class ArrayTarget extends Target
|
||
|
{
|
||
|
public $exportInterval = 1000000;
|
||
|
|
||
|
/**
|
||
|
* Exports log [[messages]] to a specific destination.
|
||
|
*/
|
||
|
public function export()
|
||
|
{
|
||
|
// throw exception if message limit is reached
|
||
|
throw new Exception('More than 1000000 messages logged.');
|
||
|
}
|
||
|
}
|