function EventLogger::trace
Overrides Tracer::trace
File
-
vendor/
phpunit/ phpunit/ src/ Logging/ EventLogger.php, line 40
Class
- EventLogger
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\LoggingCode
public function trace(Event $event) : void {
$telemetryInfo = $this->telemetryInfo($event);
$indentation = PHP_EOL . str_repeat(' ', strlen($telemetryInfo));
$lines = preg_split('/\\r\\n|\\r|\\n/', $event->asString());
$flags = FILE_APPEND;
if (!(PHP_OS_FAMILY === 'Windows' || PHP_OS_FAMILY === 'Darwin') || $this->path !== 'php://stdout') {
$flags |= LOCK_EX;
}
file_put_contents($this->path, $telemetryInfo . implode($indentation, $lines) . PHP_EOL, $flags);
}