Replace call for Logger with DI::logger()

pull/1594/head
Art4 2025-01-24 10:53:01 +00:00
parent 1cc5a6688e
commit 4310c1355d
20 changed files with 21 additions and 40 deletions

View File

@ -36,7 +36,6 @@
use Friendica\BaseModule;
use Friendica\Content\Text\Markdown;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
@ -62,7 +61,7 @@ function advancedcontentfilter_install()
Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition');
DBStructure::performUpdate();
Logger::notice('installed advancedcontentfilter');
DI::logger()->notice('installed advancedcontentfilter');
}
/*

View File

@ -7,7 +7,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
@ -27,7 +26,7 @@ function birdavatar_install()
Hook::register('addon_settings', __FILE__, 'birdavatar_addon_settings');
Hook::register('addon_settings_post', __FILE__, 'birdavatar_addon_settings_post');
Logger::info('registered birdavatar');
DI::logger()->info('registered birdavatar');
}
/**

View File

@ -45,7 +45,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\DI;
@ -77,7 +76,7 @@ function blackout_redirect ($b)
}
if (( $date1 <= $now ) && ( $now <= $date2 )) {
Logger::notice('redirecting user to blackout page');
DI::logger()->notice('redirecting user to blackout page');
System::externalRedirect($myurl);
}
}

View File

@ -7,7 +7,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
@ -27,7 +26,7 @@ function catavatar_install()
Hook::register('addon_settings', __FILE__, 'catavatar_addon_settings');
Hook::register('addon_settings_post', __FILE__, 'catavatar_addon_settings_post');
Logger::notice('registered catavatar');
DI::logger()->notice('registered catavatar');
}
/**

View File

@ -8,7 +8,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
@ -17,7 +16,7 @@ function fromapp_install()
Hook::register('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
Hook::register('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
Hook::register('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
Logger::notice("installed fromapp");
DI::logger()->notice("installed fromapp");
}
function fromapp_settings_post($post)

View File

@ -7,7 +7,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Config\Util\ConfigFileManager;
@ -45,7 +44,7 @@ function geonames_post_hook(array &$item)
* - The profile owner must have allowed our addon
*/
Logger::notice('geonames invoked');
DI::logger()->notice('geonames invoked');
if (!DI::userSession()->getLocalUserId()) { /* non-zero if this is a logged in user of this system */
return;

View File

@ -9,7 +9,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\Notification;
@ -20,7 +19,7 @@ function gnot_install()
Hook::register('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Hook::register('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
Logger::notice("installed gnot");
DI::logger()->notice("installed gnot");
}
/**

View File

@ -8,13 +8,12 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
function googlemaps_install()
{
Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
Logger::notice('installed googlemaps');
DI::logger()->notice('installed googlemaps');
}
function googlemaps_location(&$item)

View File

@ -8,7 +8,6 @@
use Friendica\BaseModule;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Config\Util\ConfigFileManager;
@ -20,7 +19,7 @@ function gravatar_install() {
Hook::register('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config');
Hook::register('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
Logger::notice("registered gravatar in avatar_lookup hook");
DI::logger()->notice("registered gravatar in avatar_lookup hook");
}
function gravatar_load_config(ConfigFileManager $loader)

View File

@ -9,7 +9,6 @@
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Config\Util\ConfigFileManager;
@ -20,7 +19,7 @@ function impressum_install()
Hook::register('load_config', 'addon/impressum/impressum.php', 'impressum_load_config');
Hook::register('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
Hook::register('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
Logger::notice("installed impressum Addon");
DI::logger()->notice("installed impressum Addon");
}
/**

View File

@ -7,7 +7,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
@ -37,7 +36,7 @@ function keycloakpassword_request($client_id, $secret, $url, $params = [])
$res = curl_exec($ch);
if (curl_errno($ch)) {
Logger::error(curl_error($ch));
DI::logger()->error(curl_error($ch));
}
curl_close($ch);

View File

@ -11,7 +11,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
@ -31,7 +30,7 @@ function krynn_install()
Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
Logger::notice("installed krynn");
DI::logger()->notice("installed krynn");
}
function krynn_post_hook(&$item)

View File

@ -7,7 +7,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\DI;
function leistungsschutzrecht_install()
@ -168,7 +167,7 @@ function leistungsschutzrecht_cron($b)
if ($last) {
$next = $last + 86400;
if ($next > time()) {
Logger::notice('poll intervall not reached');
DI::logger()->notice('poll intervall not reached');
return;
}
}

View File

@ -8,7 +8,6 @@
use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Config\Util\ConfigFileManager;
@ -20,7 +19,7 @@ function libravatar_install()
{
Hook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config');
Hook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
Logger::notice("registered libravatar in avatar_lookup hook");
DI::logger()->notice("registered libravatar in avatar_lookup hook");
}
function libravatar_load_config(ConfigFileManager $loader)

View File

@ -8,7 +8,6 @@
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\User;
@ -16,7 +15,7 @@ use Friendica\Model\User;
function newmemberwidget_install()
{
Hook::register( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
Logger::notice('newmemberwidget installed');
DI::logger()->notice('newmemberwidget installed');
}
function newmemberwidget_network_mod_init ($b)

View File

@ -7,7 +7,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
@ -16,7 +15,7 @@ function numfriends_install() {
Hook::register('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
Hook::register('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
Logger::notice("installed numfriends");
DI::logger()->notice("installed numfriends");
}
/**

View File

@ -9,7 +9,6 @@
use Friendica\DI;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Model\Contact;
use Friendica\Model\User;
@ -18,7 +17,7 @@ function opmlexport_install()
{
Hook::register('addon_settings', __FILE__, 'opmlexport_addon_settings');
Hook::register('addon_settings_post', __FILE__, 'opmlexport_addon_settings_post');
Logger::notice('installed opmlexport Addon');
DI::logger()->notice('installed opmlexport Addon');
}

View File

@ -36,7 +36,6 @@
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Config\Util\ConfigFileManager;
@ -45,7 +44,7 @@ function piwik_install() {
Hook::register('load_config', 'addon/piwik/piwik.php', 'piwik_load_config');
Hook::register('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
Logger::notice("installed piwik addon");
DI::logger()->notice("installed piwik addon");
}
function piwik_load_config(ConfigFileManager $loader)

View File

@ -1,5 +1,5 @@
<?php
use Friendica\Core\Logger;
use Friendica\DI;
function pumpio_sync_run(array $argv, int $argc) {
@ -8,7 +8,7 @@ function pumpio_sync_run(array $argv, int $argc) {
if (function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if (intval($load[0]) > DI::config()->get('system', 'maxloadavg', 50)) {
Logger::notice('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.');
DI::logger()->notice('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.');
return;
}
}

View File

@ -8,7 +8,6 @@
use Friendica\Addon\securemail\SecureTestEmail;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Object\EMail\IEmail;
@ -22,7 +21,7 @@ function securemail_install()
Hook::register('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare', 10);
Logger::notice('installed securemail');
DI::logger()->notice('installed securemail');
}
/**