]> git.mxchange.org Git - friendica.git/commitdiff
Switch all item deletion logging to info level
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 4 Mar 2020 20:59:19 +0000 (15:59 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 4 Mar 2020 20:59:19 +0000 (15:59 -0500)
src/Database/Database.php
src/Model/Item.php
src/Worker/DBClean.php
src/Worker/Expire.php
src/Worker/RemoveContact.php

index 50b45d675ffb576d4b1cdd3abc551bb744a6df49..f86f279965ab0e430734d13c0f35a3ceff4436d7 100644 (file)
@@ -1262,7 +1262,7 @@ class Database
 
                        if ((count($command['conditions']) > 1) || is_int($first_key)) {
                                $sql = "DELETE FROM " . DBA::quoteIdentifier($command['table']) . " " . $condition_string;
-                               $this->logger->debug($this->replaceParameters($sql, $conditions), ['callstack' => System::callstack(6), 'internal_callstack' => $callstack]);
+                               $this->logger->info($this->replaceParameters($sql, $conditions), ['callstack' => System::callstack(6), 'internal_callstack' => $callstack]);
 
                                if (!$this->e($sql, $conditions)) {
                                        if ($do_transaction) {
@@ -1292,7 +1292,7 @@ class Database
                                        $sql = "DELETE FROM " . DBA::quoteIdentifier($table) . " WHERE " . DBA::quoteIdentifier($field) . " IN (" .
                                               substr(str_repeat("?, ", count($field_values)), 0, -2) . ");";
 
-                                       $this->logger->debug($this->replaceParameters($sql, $field_values), ['callstack' => System::callstack(6), 'internal_callstack' => $callstack]);
+                                       $this->logger->info($this->replaceParameters($sql, $field_values), ['callstack' => System::callstack(6), 'internal_callstack' => $callstack]);
 
                                        if (!$this->e($sql, $field_values)) {
                                                if ($do_transaction) {
index df5fc1976ed17398ed9f28b65b778fe04f302418..063a338742d2781c441c1d58780f6eeac30f771c 100644 (file)
@@ -1116,7 +1116,7 @@ class Item
         */
        public static function markForDeletionById($item_id, $priority = PRIORITY_HIGH)
        {
-               Logger::notice('Mark item for deletion by id', ['id' => $item_id, 'callstack' => System::callstack()]);
+               Logger::info('Mark item for deletion by id', ['id' => $item_id, 'callstack' => System::callstack()]);
                // locate item to be deleted
                $fields = ['id', 'uri', 'uid', 'parent', 'parent-uri', 'origin',
                        'deleted', 'file', 'resource-id', 'event-id', 'attach',
@@ -1124,12 +1124,12 @@ class Item
                        'icid', 'iaid', 'psid'];
                $item = self::selectFirst($fields, ['id' => $item_id]);
                if (!DBA::isResult($item)) {
-                       Logger::debug('Item not found.', ['id' => $item_id]);
+                       Logger::info('Item not found.', ['id' => $item_id]);
                        return false;
                }
 
                if ($item['deleted']) {
-                       Logger::debug('Item has already been marked for deletion.', ['id' => $item_id]);
+                       Logger::info('Item has already been marked for deletion.', ['id' => $item_id]);
                        return false;
                }
 
@@ -1238,7 +1238,7 @@ class Item
                        }
                }
 
-               Logger::debug('Item has been marked for deletion.', ['id' => $item_id]);
+               Logger::info('Item has been marked for deletion.', ['id' => $item_id]);
 
                return true;
        }
@@ -1938,7 +1938,7 @@ class Item
 
                if ($entries > 1) {
                        // There are duplicates. We delete our just created entry.
-                       Logger::notice('Delete duplicated item', ['id' => $current_post, 'uri' => $item['uri'], 'uid' => $item['uid'], 'guid' => $item['guid']]);
+                       Logger::info('Delete duplicated item', ['id' => $current_post, 'uri' => $item['uri'], 'uid' => $item['uid'], 'guid' => $item['guid']]);
 
                        // Yes, we could do a rollback here - but we are having many users with MyISAM.
                        DBA::delete('item', ['id' => $current_post]);
@@ -2721,7 +2721,7 @@ class Item
                if (!$mention) {
                        if (($community_page || $prvgroup) &&
                                  !$item['wall'] && !$item['origin'] && ($item['id'] == $item['parent'])) {
-                               Logger::notice('Delete private group/communiy top-level item without mention', ['id' => $item_id, 'guid'=> $item['guid']]);
+                               Logger::info('Delete private group/communiy top-level item without mention', ['id' => $item_id, 'guid'=> $item['guid']]);
                                DBA::delete('item', ['id' => $item_id]);
                                return true;
                        }
index 19d95b67526898a900152701b8be3ce7141b4fdb..0316b9ebf6ebdef744938dac6ce698f63c0f6321 100644 (file)
@@ -107,7 +107,7 @@ class DBClean {
                                Logger::log("found global item orphans: ".$count);
                                while ($orphan = DBA::fetch($r)) {
                                        $last_id = $orphan["id"];
-                                       Logger::notice('Delete global orphan item', ['id' => $orphan['id'], 'guid' => $orphan['guid']]);
+                                       Logger::info('Delete global orphan item', ['id' => $orphan['id'], 'guid' => $orphan['guid']]);
                                        DBA::delete('item', ['id' => $orphan["id"]]);
                                }
                                Worker::add(PRIORITY_MEDIUM, 'DBClean', 1, $last_id);
@@ -130,7 +130,7 @@ class DBClean {
                                Logger::log("found item orphans without parents: ".$count);
                                while ($orphan = DBA::fetch($r)) {
                                        $last_id = $orphan["id"];
-                                       Logger::notice('Delete orphan item', ['id' => $orphan['id'], 'guid' => $orphan['guid']]);
+                                       Logger::info('Delete orphan item', ['id' => $orphan['id'], 'guid' => $orphan['guid']]);
                                        DBA::delete('item', ['id' => $orphan["id"]]);
                                }
                                Worker::add(PRIORITY_MEDIUM, 'DBClean', 2, $last_id);
@@ -328,7 +328,7 @@ class DBClean {
                                Logger::log("found global item entries from expired threads: ".$count);
                                while ($orphan = DBA::fetch($r)) {
                                        $last_id = $orphan["id"];
-                                       Logger::notice('Delete expired thread item', ['id' => $orphan['id'], 'guid' => $orphan['guid']]);
+                                       Logger::info('Delete expired thread item', ['id' => $orphan['id'], 'guid' => $orphan['guid']]);
                                        DBA::delete('item', ['id' => $orphan["id"]]);
                                }
                                Worker::add(PRIORITY_MEDIUM, 'DBClean', 9, $last_id);
index bccb439e500dfc98e0126fb06adca00c72ed050d..f98d56ed0c43ad429ca336d65d18d546a4205277 100644 (file)
@@ -45,7 +45,7 @@ class Expire
                        $condition = ["`deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"];
                        $rows = DBA::select('item', ['id', 'guid'],  $condition);
                        while ($row = DBA::fetch($rows)) {
-                               Logger::notice('Delete expired item', ['id' => $row['id'], 'guid' => $row['guid']]);
+                               Logger::info('Delete expired item', ['id' => $row['id'], 'guid' => $row['guid']]);
                                DBA::delete('item', ['id' => $row['id']]);
                        }
                        DBA::close($rows);
index cfec2c1846ce724f2cbf45ae0efda3b54ba7c12f..28a32160a014c7c830f5f5d5fb71952701792030 100644 (file)
@@ -43,7 +43,7 @@ class RemoveContact {
                do {
                        $items = Item::select(['id', 'guid'], $condition, ['limit' => 100]);
                        while ($item = Item::fetch($items)) {
-                               Logger::notice('Delete removed contact item', ['id' => $item['id'], 'guid' => $item['guid']]);
+                               Logger::info('Delete removed contact item', ['id' => $item['id'], 'guid' => $item['guid']]);
                                DBA::delete('item', ['id' => $item['id']]);
                        }
                        DBA::close($items);