diff --git a/engine/classes/Elgg/Cache/CompositeCache.php b/engine/classes/Elgg/Cache/CompositeCache.php index d08cb593001..8fa3beecb30 100644 --- a/engine/classes/Elgg/Cache/CompositeCache.php +++ b/engine/classes/Elgg/Cache/CompositeCache.php @@ -105,7 +105,7 @@ public function load($key) { return $item->get(); } catch (PhpfastcacheRootException $e) { // something wrong with the cache - elgg_log($e->getMessage(), 'ERROR'); + elgg_log($e->getMessage(), \Psr\Log\LogLevel::ERROR); return null; } } diff --git a/engine/classes/Elgg/Cache/Config/Redis.php b/engine/classes/Elgg/Cache/Config/Redis.php index 467b6a5e014..525af81fcb7 100644 --- a/engine/classes/Elgg/Cache/Config/Redis.php +++ b/engine/classes/Elgg/Cache/Config/Redis.php @@ -36,7 +36,7 @@ public static function fromElggConfig(string $namespace, \Elgg\Config $config): } if (count($config->redis_servers) > 1) { - elgg_log('Multiple Redis servers are not supported. Only the first server will be used. Please update the configuration in elgg-config/settings.php', 'warning'); + elgg_log('Multiple Redis servers are not supported. Only the first server will be used. Please update the configuration in elgg-config/settings.php', \Psr\Log\LogLevel::WARNING); } $server = $config->redis_servers[0]; diff --git a/engine/classes/Elgg/Traits/Seeding.php b/engine/classes/Elgg/Traits/Seeding.php index cd6919dd9df..7935e6d79f7 100644 --- a/engine/classes/Elgg/Traits/Seeding.php +++ b/engine/classes/Elgg/Traits/Seeding.php @@ -884,7 +884,6 @@ public function createLikes(\ElggEntity $entity, $limit = null): int { * * @param string $msg Message to log * @param string $level Message level - * Note that 'ERROR' will terminate further code execution * * @return void */ diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 2c197a0798e..f3c7adfa901 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -78,7 +78,9 @@ function elgg_register_error_message(string|array $options): void { * @note Use the developers plugin to display logs * * @param string $message User message - * @param string $level NOTICE | WARNING | ERROR + * @param string $level Log level + * + * @see \Psr\Log\LogLevel constants * * @return void * @since 1.7.0 diff --git a/mod/discussions/views/default/object/discussion.php b/mod/discussions/views/default/object/discussion.php index f51898a6559..5beb58ff1f0 100644 --- a/mod/discussions/views/default/object/discussion.php +++ b/mod/discussions/views/default/object/discussion.php @@ -16,7 +16,7 @@ $poster = $entity->getOwnerEntity(); if (!$poster instanceof ElggEntity) { $msg = "User {$entity->owner_guid} could not be loaded, and is needed to display entity {$entity->guid}"; - elgg_log($msg, 'WARNING'); + elgg_log($msg, \Psr\Log\LogLevel::WARNING); if ($full_view) { throw new EntityNotFoundException($msg); }