Ver Fonte

Merge pull request #728 from danizord/hotfix/avoid-needless-formatter

Instantiate LineFormatter only when configured to use short attachment
Jordi Boggiano há 10 anos atrás
pai
commit
e1ee9d4989
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      src/Monolog/Handler/SlackHandler.php

+ 2 - 1
src/Monolog/Handler/SlackHandler.php

@@ -96,7 +96,8 @@ class SlackHandler extends SocketHandler
         $this->useAttachment = $useAttachment;
         $this->useShortAttachment = $useShortAttachment;
         $this->includeContextAndExtra = $includeContextAndExtra;
-        if ($this->includeContextAndExtra) {
+
+        if ($this->includeContextAndExtra && $this->useShortAttachment) {
             $this->lineFormatter = new LineFormatter;
         }
     }