refactor(logging): remove redundant log record creation in DefaultLogger handlers loop
This commit is contained in:
@@ -138,20 +138,6 @@ final readonly class DefaultLogger implements Logger, SupportsChannels
|
|||||||
// Alle Handler durchlaufen
|
// Alle Handler durchlaufen
|
||||||
foreach ($this->handlers as $handler) {
|
foreach ($this->handlers as $handler) {
|
||||||
if ($handler->isHandling($processedRecord)) {
|
if ($handler->isHandling($processedRecord)) {
|
||||||
|
|
||||||
$array = explode('\\',$handler::class);
|
|
||||||
$handlerName = end($array);
|
|
||||||
|
|
||||||
// Log-Record erstellen
|
|
||||||
$record = new LogRecord(
|
|
||||||
message: $handlerName . ' --- ' . $message,
|
|
||||||
context: $finalContext,
|
|
||||||
level: $level,
|
|
||||||
timestamp: $this->clock->now(),
|
|
||||||
channel: $channel
|
|
||||||
);
|
|
||||||
$processedRecord = $this->processorManager->processRecord($record);
|
|
||||||
|
|
||||||
$handler->handle($processedRecord);
|
$handler->handle($processedRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user