X7ROOT File Manager
Current Path:
/home/prisjneg/public_html/vendor/monolog/monolog/src/Monolog/Processor
home
/
prisjneg
/
public_html
/
vendor
/
monolog
/
monolog
/
src
/
Monolog
/
Processor
/
π
..
π
ClosureContextProcessor.php
(1.48 KB)
π
GitProcessor.php
(1.94 KB)
π
HostnameProcessor.php
(736 B)
π
IntrospectionProcessor.php
(3.7 KB)
π
LoadAverageProcessor.php
(1.59 KB)
π
MemoryPeakUsageProcessor.php
(864 B)
π
MemoryProcessor.php
(1.76 KB)
π
MemoryUsageProcessor.php
(845 B)
π
MercurialProcessor.php
(2.05 KB)
π
ProcessIdProcessor.php
(635 B)
π
ProcessorInterface.php
(576 B)
π
PsrLogMessageProcessor.php
(3 KB)
π
TagProcessor.php
(1.17 KB)
π
UidProcessor.php
(1.46 KB)
π
WebProcessor.php
(3.39 KB)
Editing: UidProcessor.php
<?php declare(strict_types=1); /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Processor; use Monolog\ResettableInterface; use Monolog\LogRecord; /** * Adds a unique identifier into records * * @author Simon MΓΆnch <sm@webfactory.de> */ class UidProcessor implements ProcessorInterface, ResettableInterface { /** @var non-empty-string */ private string $uid; /** * @param int<1, 32> $length */ public function __construct(int $length = 7) { if ($length > 32 || $length < 1) { throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); } $this->uid = $this->generateUid($length); } /** * @inheritDoc */ public function __invoke(LogRecord $record): LogRecord { $record->extra['uid'] = $this->uid; return $record; } public function getUid(): string { return $this->uid; } public function reset(): void { $this->uid = $this->generateUid(\strlen($this->uid)); } /** * @param positive-int $length * @return non-empty-string */ private function generateUid(int $length): string { return substr(bin2hex(random_bytes((int) ceil($length / 2))), 0, $length); } }
Upload File
Create Folder