瀏覽代碼

Update Core\Log

Visman 3 年之前
父節點
當前提交
2da049169e
共有 1 個文件被更改,包括 6 次插入6 次删除
  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')
             && \method_exists($message, '__toString')
         ) {
         ) {
             $message = (string) $message;
             $message = (string) $message;
-        }
 
 
-        if (! \is_string($message)) {
+        } elseif (! \is_string($message)) {
             throw new InvalidArgumentException('Expected string in message');
             throw new InvalidArgumentException('Expected string in message');
         }
         }
 
 
-        $message = $this->c->Secury->replInvalidChars($message);
-
         if (! \is_string($level)) {
         if (! \is_string($level)) {
             throw new InvalidArgumentException('Expected string in level');
             throw new InvalidArgumentException('Expected string in level');
         }
         }
@@ -95,9 +92,12 @@ class Log implements LoggerInterface
                 throw new InvalidArgumentException('Invalid level value');
                 throw new InvalidArgumentException('Invalid level value');
         }
         }
 
 
-        $context = $this->c->Secury->replInvalidChars($context);
         $context = $this->contextExp($level, $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)) {
         if (! \is_resource($this->resource)) {
             $this->initResource();
             $this->initResource();