]> git.mxchange.org Git - friendica.git/commitdiff
Replace Logger with DI::logger() in mod folder
authorArt4 <art4@wlabs.de>
Mon, 13 Jan 2025 08:56:33 +0000 (08:56 +0000)
committerArt4 <art4@wlabs.de>
Mon, 13 Jan 2025 08:56:33 +0000 (08:56 +0000)
mod/item.php
mod/photos.php

index c47dbac44d730d455072aeb5ae68e02ce07c4cf6..efc603f983e39fb750c9c5374ccd0c1d7f3c282f 100644 (file)
@@ -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
index c9fa60bca03caf8087076d79e3bdabe03f821ce5..04b62055c2527eaacbbbc2cfe4381f93c027b4d7 100644 (file)
@@ -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);