Jelajahi Sumber

Update comments

Jordi Boggiano 11 tahun lalu
induk
melakukan
673e275c00
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      src/Monolog/Logger.php

+ 2 - 3
src/Monolog/Logger.php

@@ -231,7 +231,7 @@ class Logger implements LoggerInterface
 
 
         $levelName = static::getLevelName($level);
         $levelName = static::getLevelName($level);
 
 
-        // check if any handler will handle this message
+        // check if any handler will handle this message so we can return early and save cycles
         $handlerKey = null;
         $handlerKey = null;
         foreach ($this->handlers as $key => $handler) {
         foreach ($this->handlers as $key => $handler) {
             if ($handler->isHandling(array('level' => $level))) {
             if ($handler->isHandling(array('level' => $level))) {
@@ -239,7 +239,7 @@ class Logger implements LoggerInterface
                 break;
                 break;
             }
             }
         }
         }
-        // none found
+
         if (null === $handlerKey) {
         if (null === $handlerKey) {
             return false;
             return false;
         }
         }
@@ -258,7 +258,6 @@ class Logger implements LoggerInterface
             'extra' => array(),
             'extra' => array(),
         );
         );
 
 
-        // found at least one, process message and dispatch it
         foreach ($this->processors as $processor) {
         foreach ($this->processors as $processor) {
             $record = call_user_func($processor, $record);
             $record = call_user_func($processor, $record);
         }
         }