0 follower

Class Yiisoft\Yii\Debug\Collector\LogCollector

InheritanceYiisoft\Yii\Debug\Collector\LogCollector
ImplementsYiisoft\Yii\Debug\Collector\SummaryCollectorInterface
Uses TraitsYiisoft\Yii\Debug\Collector\CollectorTrait

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Yii\Debug\Collector\TimelineCollector $timelineCollector )
$timelineCollector Yiisoft\Yii\Debug\Collector\TimelineCollector

                public function __construct(
    private readonly TimelineCollector $timelineCollector
) {
}

            
collect() public method

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));
}

            
getCollected() public method

public array getCollected ( )

                public function getCollected(): array
{
    if (!$this->isActive()) {
        return [];
    }
    return $this->messages;
}

            
getName() public method
public string getName ( )

                public function getName(): string
{
    return self::class;
}

            
getSummary() public method

public array getSummary ( )

                public function getSummary(): array
{
    if (!$this->isActive()) {
        return [];
    }
    return [
        'total' => count($this->messages),
    ];
}

            
shutdown() public method
public void shutdown ( )

                public function shutdown(): void
{
    $this->reset();
    $this->isActive = false;
}

            
startup() public method
public void startup ( )

                public function startup(): void
{
    $this->isActive = true;
}