From cee80c4eb60e5486d65c499d5aebf09814f0e5b2 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 15 Feb 2023 18:44:06 +0000
Subject: [PATCH] Issue #3255699 by mfb, xjm, andrea.cividini, quietone,
 smustgrave: Demote routine content entity log entries from "notice" to "info"

---
 core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php | 2 +-
 core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php   | 2 +-
 core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php | 4 ++--
 core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php | 2 +-
 core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php | 2 +-
 core/modules/block_content/src/BlockContentForm.php     | 4 ++--
 core/modules/book/src/Form/BookAdminEditForm.php        | 2 +-
 core/modules/media/src/MediaForm.php                    | 4 ++--
 core/modules/node/src/Form/NodeDeleteForm.php           | 2 +-
 core/modules/node/src/Form/NodeRevisionDeleteForm.php   | 2 +-
 core/modules/node/src/Form/NodeRevisionRevertForm.php   | 2 +-
 core/modules/node/src/NodeForm.php                      | 4 ++--
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php b/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php
index be0a653fbca8..45328bb0c0e3 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php
@@ -111,7 +111,7 @@ protected function logDeletionMessage() {
     $entity = $this->getEntity();
 
     if (!$entity->isDefaultTranslation()) {
-      $this->logger($entity->getEntityType()->getProvider())->notice('The @entity-type %label @language translation has been deleted.', [
+      $this->logger($entity->getEntityType()->getProvider())->info('The @entity-type %label @language translation has been deleted.', [
         '@entity-type' => $entity->getEntityType()->getSingularLabel(),
         '%label'       => $entity->label(),
         '@language'    => $entity->language()->getName(),
diff --git a/core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php b/core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php
index 087d2391effa..8eb8ed04b876 100644
--- a/core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php
+++ b/core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php
@@ -109,7 +109,7 @@ protected function getRedirectUrl() {
    */
   protected function logDeletionMessage() {
     $entity = $this->getEntity();
-    $this->logger($entity->getEntityType()->getProvider())->notice('The @entity-type %label has been deleted.', [
+    $this->logger($entity->getEntityType()->getProvider())->info('The @entity-type %label has been deleted.', [
       '@entity-type' => $entity->getEntityType()->getSingularLabel(),
       '%label' => $entity->label(),
     ]);
diff --git a/core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php b/core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php
index 2ff504cef15c..c24b539a0cd7 100644
--- a/core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php
+++ b/core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php
@@ -258,7 +258,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($delete_entities) {
       $storage->delete($delete_entities);
       foreach ($delete_entities as $entity) {
-        $this->logger($entity->getEntityType()->getProvider())->notice('The @entity-type %label has been deleted.', [
+        $this->logger($entity->getEntityType()->getProvider())->info('The @entity-type %label has been deleted.', [
           '@entity-type' => $entity->getEntityType()->getSingularLabel(),
           '%label' => $entity->label(),
         ]);
@@ -274,7 +274,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
         }
         $entity->save();
         foreach ($translations as $translation) {
-          $this->logger($entity->getEntityType()->getProvider())->notice('The @entity-type %label @language translation has been deleted.', [
+          $this->logger($entity->getEntityType()->getProvider())->info('The @entity-type %label @language translation has been deleted.', [
             '@entity-type' => $entity->getEntityType()->getSingularLabel(),
             '%label'       => $entity->label(),
             '@language'    => $translation->language()->getName(),
diff --git a/core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php b/core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php
index 7c3fdd177a49..40b73e2cfaf6 100644
--- a/core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php
+++ b/core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php
@@ -156,7 +156,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       $this->messenger->addStatus($this->t('Revision of @type %title has been deleted.', $messengerArgs));
     }
 
-    $this->logger($this->revision->getEntityType()->getProvider())->notice('@type: deleted %title revision %revision.', [
+    $this->logger($this->revision->getEntityType()->getProvider())->info('@type: deleted %title revision %revision.', [
       '@type' => $this->revision->bundle(),
       '%title' => $this->revision->label(),
       '%revision' => $this->revision->getRevisionId(),
diff --git a/core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php b/core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php
index 39665c35099b..3eb716fc6bfe 100644
--- a/core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php
+++ b/core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php
@@ -180,7 +180,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       ]));
     }
 
-    $this->logger($this->revision->getEntityType()->getProvider())->notice('@type: reverted %title revision %revision.', [
+    $this->logger($this->revision->getEntityType()->getProvider())->info('@type: reverted %title revision %revision.', [
       '@type' => $this->revision->bundle(),
       '%title' => $revisionLabel,
       '%revision' => $revisionId,
diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php
index f87d6217bc99..1a739a09881a 100644
--- a/core/modules/block_content/src/BlockContentForm.php
+++ b/core/modules/block_content/src/BlockContentForm.php
@@ -53,11 +53,11 @@ public function save(array $form, FormStateInterface $form_state) {
     $t_args = ['@type' => $block_type->label(), '%info' => $block->label()];
 
     if ($insert) {
-      $logger->notice('@type: added %info.', $context);
+      $logger->info('@type: added %info.', $context);
       $this->messenger()->addStatus($this->t('@type %info has been created.', $t_args));
     }
     else {
-      $logger->notice('@type: updated %info.', $context);
+      $logger->info('@type: updated %info.', $context);
       $this->messenger()->addStatus($this->t('@type %info has been updated.', $t_args));
     }
 
diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php
index 863ccc8a8cae..0140eb6f1235 100644
--- a/core/modules/book/src/Form/BookAdminEditForm.php
+++ b/core/modules/book/src/Form/BookAdminEditForm.php
@@ -134,7 +134,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
             $node->book['link_title'] = $values['title'];
             $node->setNewRevision();
             $node->save();
-            $this->logger('content')->notice('book: updated %title.', ['%title' => $node->label(), 'link' => $node->toLink($this->t('View'))->toString()]);
+            $this->logger('content')->info('book: updated %title.', ['%title' => $node->label(), 'link' => $node->toLink($this->t('View'))->toString()]);
           }
         }
       }
diff --git a/core/modules/media/src/MediaForm.php b/core/modules/media/src/MediaForm.php
index 45cff5fdca5d..93a9776f09ed 100644
--- a/core/modules/media/src/MediaForm.php
+++ b/core/modules/media/src/MediaForm.php
@@ -64,11 +64,11 @@ public function save(array $form, FormStateInterface $form_state) {
     $t_args = ['@type' => $this->entity->bundle->entity->label(), '%label' => $this->entity->toLink($this->entity->label())->toString()];
 
     if ($saved === SAVED_NEW) {
-      $logger->notice('@type: added %label.', $context);
+      $logger->info('@type: added %label.', $context);
       $this->messenger()->addStatus($this->t('@type %label has been created.', $t_args));
     }
     else {
-      $logger->notice('@type: updated %label.', $context);
+      $logger->info('@type: updated %label.', $context);
       $this->messenger()->addStatus($this->t('@type %label has been updated.', $t_args));
     }
 
diff --git a/core/modules/node/src/Form/NodeDeleteForm.php b/core/modules/node/src/Form/NodeDeleteForm.php
index 7a455cdddbbe..a0c96e3cec66 100644
--- a/core/modules/node/src/Form/NodeDeleteForm.php
+++ b/core/modules/node/src/Form/NodeDeleteForm.php
@@ -41,7 +41,7 @@ protected function getDeletionMessage() {
   protected function logDeletionMessage() {
     /** @var \Drupal\node\NodeInterface $entity */
     $entity = $this->getEntity();
-    $this->logger('content')->notice('@type: deleted %title.', ['@type' => $entity->getType(), '%title' => $entity->label()]);
+    $this->logger('content')->info('@type: deleted %title.', ['@type' => $entity->getType(), '%title' => $entity->label()]);
   }
 
 }
diff --git a/core/modules/node/src/Form/NodeRevisionDeleteForm.php b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
index be63883481e6..072d2fbc1b60 100644
--- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php
+++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
@@ -131,7 +131,7 @@ public function buildForm(array $form, FormStateInterface $form_state, NodeInter
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->nodeStorage->deleteRevision($this->revision->getRevisionId());
 
-    $this->logger('content')->notice('@type: deleted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
+    $this->logger('content')->info('@type: deleted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
     $node_type = $this->nodeTypeStorage->load($this->revision->bundle())->label();
     $this->messenger()
       ->addStatus($this->t('Revision from %revision-date of @type %title has been deleted.', [
diff --git a/core/modules/node/src/Form/NodeRevisionRevertForm.php b/core/modules/node/src/Form/NodeRevisionRevertForm.php
index b223e30f40d9..beb6ffd52597 100644
--- a/core/modules/node/src/Form/NodeRevisionRevertForm.php
+++ b/core/modules/node/src/Form/NodeRevisionRevertForm.php
@@ -133,7 +133,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->revision->setChangedTime($this->time->getRequestTime());
     $this->revision->save();
 
-    $this->logger('content')->notice('@type: reverted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
+    $this->logger('content')->info('@type: reverted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
     $this->messenger()
       ->addStatus($this->t('@type %title has been reverted to the revision from %revision-date.', [
         '@type' => node_get_type_label($this->revision),
diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php
index ef167c82bd13..709b6af93e09 100644
--- a/core/modules/node/src/NodeForm.php
+++ b/core/modules/node/src/NodeForm.php
@@ -273,11 +273,11 @@ public function save(array $form, FormStateInterface $form_state) {
     $t_args = ['@type' => node_get_type_label($node), '%title' => $node->toLink()->toString()];
 
     if ($insert) {
-      $this->logger('content')->notice('@type: added %title.', $context);
+      $this->logger('content')->info('@type: added %title.', $context);
       $this->messenger()->addStatus($this->t('@type %title has been created.', $t_args));
     }
     else {
-      $this->logger('content')->notice('@type: updated %title.', $context);
+      $this->logger('content')->info('@type: updated %title.', $context);
       $this->messenger()->addStatus($this->t('@type %title has been updated.', $t_args));
     }
 
-- 
GitLab