From ef0fe65c07a34a9192a1b2b36806332d56e42f86 Mon Sep 17 00:00:00 2001 From: Art4 Date: Mon, 13 Jan 2025 08:56:33 +0000 Subject: [PATCH] Replace Logger with DI::logger() in mod folder --- mod/item.php | 14 +++++++------- mod/photos.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mod/item.php b/mod/item.php index c47dbac44d..efc603f983 100644 --- a/mod/item.php +++ b/mod/item.php @@ -56,7 +56,7 @@ function item_post() */ if (!$preview && !empty($_REQUEST['post_id_random'])) { if (DI::session()->get('post-random') == $_REQUEST['post_id_random']) { - Logger::warning('duplicate post'); + DI::logger()->warning('duplicate post'); item_post_return(DI::baseUrl(), $return_path); } else { DI::session()->set('post-random', $_REQUEST['post_id_random']); @@ -165,7 +165,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat // This enables interaction like starring and saving into folders if ($toplevel_item['uid'] == 0) { $stored = Item::storeForUserByUriId($toplevel_item['uri-id'], $post['uid'], ['post-reason' => Item::PR_ACTIVITY]); - Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]); + DI::logger()->info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]); } $post['parent'] = $toplevel_item['id']; @@ -197,7 +197,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat $post = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]); if (!$post) { - Logger::error('Item couldn\'t be fetched.', ['post_id' => $post_id]); + DI::logger()->error('Item couldn\'t be fetched.', ['post_id' => $post_id]); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -213,7 +213,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat DI::contentItem()->copyPermissions($post['thr-parent-id'], $post['uri-id'], $post['parent-uri-id']); } - Logger::debug('post_complete'); + DI::logger()->debug('post_complete'); item_post_return(DI::baseUrl(), $return_path); // NOTREACHED @@ -297,7 +297,7 @@ function item_process(array $post, array $request, bool $preview, string $return } if (!empty($post['cancel'])) { - Logger::info('mod_item: post cancelled by addon.'); + DI::logger()->info('mod_item: post cancelled by addon.'); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -324,7 +324,7 @@ function item_post_return($baseurl, $return_path) $json['reload'] = $baseurl . '/' . $_REQUEST['jsreload']; } - Logger::debug('post_json', ['json' => $json]); + DI::logger()->debug('post_json', ['json' => $json]); System::jsonExit($json); } @@ -444,7 +444,7 @@ function drop_item(int $id, string $return = ''): string item_redirect_after_action($item, $return); //NOTREACHED } else { - Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]); + DI::logger()->warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]); DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('display/' . $item['guid']); //NOTREACHED diff --git a/mod/photos.php b/mod/photos.php index c9fa60bca0..04b62055c2 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -277,7 +277,7 @@ function photos_post() } if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) { - Logger::debug('rotate'); + DI::logger()->debug('rotate'); $photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);