Jelajahi Sumber

Update Core\Log

Visman 3 tahun lalu
induk
melakukan
2da049169e
1 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 6 6
      app/Core/Log.php

+ 6 - 6
app/Core/Log.php

@@ -69,14 +69,11 @@ class Log implements LoggerInterface
             && \method_exists($message, '__toString')
         ) {
             $message = (string) $message;
-        }
 
-        if (! \is_string($message)) {
+        } elseif (! \is_string($message)) {
             throw new InvalidArgumentException('Expected string in message');
         }
 
-        $message = $this->c->Secury->replInvalidChars($message);
-
         if (! \is_string($level)) {
             throw new InvalidArgumentException('Expected string in level');
         }
@@ -95,9 +92,12 @@ class Log implements LoggerInterface
                 throw new InvalidArgumentException('Invalid level value');
         }
 
-        $context = $this->c->Secury->replInvalidChars($context);
         $context = $this->contextExp($level, $context);
-        $line    = $this->generateLine($level, $message, $context);
+        $line    = $this->generateLine(
+            $level,
+            $this->c->Secury->replInvalidChars($message),
+            $this->c->Secury->replInvalidChars($context)
+        );
 
         if (! \is_resource($this->resource)) {
             $this->initResource();