Skip to content

Commit

Permalink
Merge pull request #18 from neos/task/adjust-logger-for-flow-6
Browse files Browse the repository at this point in the history
TASK: Adjust logger calls for Flow 6.0
  • Loading branch information
daniellienert authored Sep 4, 2019
2 parents 429520a + 1be659d commit 91162e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Classes/Transport/LoggingTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\Utility\LogEnvironment;
use Neos\SwiftMailer\TransportInterface;
use Psr\Log\LoggerInterface;

/**
* A logging swift transport for functional tests and development. It stores and logs sent messages.
Expand All @@ -31,9 +33,9 @@ class LoggingTransport implements TransportInterface

/**
* @Flow\Inject
* @var \Neos\Flow\Log\SystemLoggerInterface
* @var LoggerInterface
*/
protected $systemLogger;
protected $logger;

/**
* The logging transport is always started
Expand Down Expand Up @@ -75,9 +77,9 @@ public function send(\Swift_Mime_SimpleMessage $message, &$failedRecipients = nu
{
self::$deliveredMessages[] = $message;

$this->systemLogger->log('Sent email to ' . $this->buildStringFromEmailAndNameArray($message->getTo()), LOG_DEBUG, [
'message' => $message->toString()
]);
$this->logger->debug('Sent email to ' . $this->buildStringFromEmailAndNameArray($message->getTo()),
array_merge(LogEnvironment::fromMethodName(__METHOD__), ['message' => $message->toString()])
);

return count((array)$message->getTo()) + count((array)$message->getCc()) + count((array)$message->getBcc());
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"MIT"
],
"require": {
"neos/flow": "^4.0 || ^5.0 || dev-master",
"neos/flow": "^5.2 || ^6.0 || dev-master",
"swiftmailer/swiftmailer": "^6.0"
},
"autoload": {
Expand Down

0 comments on commit 91162e2

Please sign in to comment.