Skip to content

Commit

Permalink
Merge pull request Elgg#14754 from jdalsem/6.1-fixes
Browse files Browse the repository at this point in the history
chore(core): use \Psr\Log\LogLevel constants where possible
  • Loading branch information
jeabakker authored Nov 26, 2024
2 parents 673b788 + 28445cd commit 85d9088
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion engine/classes/Elgg/Cache/CompositeCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/classes/Elgg/Cache/Config/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 0 additions & 1 deletion engine/classes/Elgg/Traits/Seeding.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 3 additions & 1 deletion engine/lib/elgglib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mod/discussions/views/default/object/discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 85d9088

Please sign in to comment.