Class Yiisoft\Yii\Debug\Collector\LogCollector
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
| Uses Traits | Yiisoft\ |
Public Methods
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $timelineCollector | Yiisoft\ |
|
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;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.