Verified Commit 2a71397e authored by Jess's avatar Jess
Browse files

Issue #3381078 by mfb, smustgrave, xjm, quietone, andypost: Demote routine log...

Issue #3381078 by mfb, smustgrave, xjm, quietone, andypost: Demote routine log events from "notice" to "info"

(cherry picked from commit 9c025861)
parent 578c5525
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ public function execute($entity = NULL) {
    $message = $this->mailManager->mail('system', 'action_send_email', $recipient, $langcode, $params);
    // Error logging is handled by \Drupal\Core\Mail\MailManager::mail().
    if ($message['result']) {
      $this->logger->notice('Sent email to %recipient', ['%recipient' => $recipient]);
      $this->logger->info('Sent email to %recipient', ['%recipient' => $recipient]);
    }
  }

+1 −1
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ public function save(array $form, FormStateInterface $form_state) {
      $form_state->setValue('cid', $comment->id());

      // Add a log entry.
      $logger->notice('Comment posted: %subject.', [
      $logger->info('Comment posted: %subject.', [
        '%subject' => $comment->getSubject(),
        'link' => Link::fromTextAndUrl(t('View'), $comment->toUrl()->setOption('fragment', 'comment-' . $comment->id()))->toString(),
      ]);
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ protected function getDeletionMessage() {
   * {@inheritdoc}
   */
  public function logDeletionMessage() {
    $this->logger('comment')->notice('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);
    $this->logger('comment')->info('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);
  }

}
+2 −2
Original line number Diff line number Diff line
@@ -133,14 +133,14 @@ public function sendMailMessages(MessageInterface $message, AccountInterface $se
    }

    if (!$message->isPersonal()) {
      $this->logger->notice('%sender-name (@sender-from) sent an email regarding %contact_form.', [
      $this->logger->info('%sender-name (@sender-from) sent an email regarding %contact_form.', [
        '%sender-name' => $sender_cloned->getAccountName(),
        '@sender-from' => $sender_cloned->getEmail() ?? '',
        '%contact_form' => $contact_form->label(),
      ]);
    }
    else {
      $this->logger->notice('%sender-name (@sender-from) sent %recipient-name an email.', [
      $this->logger->info('%sender-name (@sender-from) sent %recipient-name an email.', [
        '%sender-name' => $sender_cloned->getAccountName(),
        '@sender-from' => $sender_cloned->getEmail(),
        '%recipient-name' => $message->getPersonalRecipient()->getAccountName(),
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public function testInvalidRecipient() {
   */
  public function testSendMailMessages(MessageInterface $message, AccountInterface $sender, $results) {
    $this->logger->expects($this->once())
      ->method('notice');
      ->method('info');
    $this->mailManager->expects($this->any())
      ->method('mail')
      ->willReturnCallback(
Loading