Class Yiisoft\Yii\Debug\Collector\LogCollector
| Inheritance | Yiisoft\Yii\Debug\Collector\LogCollector |
|---|---|
| Implements | Yiisoft\Yii\Debug\Collector\SummaryCollectorInterface |
| Uses Traits | Yiisoft\Yii\Debug\Collector\CollectorTrait |
Public Methods
Method Details
| public mixed __construct ( Yiisoft\Yii\Debug\Collector\TimelineCollector $timelineCollector ) | ||
| $timelineCollector | Yiisoft\Yii\Debug\Collector\TimelineCollector | |
public function __construct(
private readonly TimelineCollector $timelineCollector
) {
}
| public void collect ( string $level, mixed $message, array $context, string $line ) | ||
| $level | string | |
| $message | mixed | |
| $context | array | |
| $line | string | |
public function collect(string $level, mixed $message, array $context, string $line): void
{
if (!$this->isActive()) {
return;
}
$this->messages[] = [
'time' => microtime(true),
'level' => $level,
'message' => $message,
'context' => $context,
'line' => $line,
];
$this->timelineCollector->collect($this, count($this->messages));
}
| public array getCollected ( ) |
public function getCollected(): array
{
if (!$this->isActive()) {
return [];
}
return $this->messages;
}
| public array getSummary ( ) |
public function getSummary(): array
{
if (!$this->isActive()) {
return [];
}
return [
'total' => count($this->messages),
];
}
| public void shutdown ( ) |
public function shutdown(): void
{
$this->reset();
$this->isActive = false;
}
Signup or Login in order to comment.