From ada741b8c7ccec08e2a89389a8bde651d62ea2a0 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Mon, 9 May 2022 08:39:44 -0400 Subject: [PATCH] allow more log --- CRM/Core/Error/Log.php | 2 +- CRM/Utils/EchoLogger.php | 2 +- CRM/Utils/SystemLogger.php | 2 +- Civi/Api4/Action/System/RotateKey.php | 2 +- composer.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Core/Error/Log.php b/CRM/Core/Error/Log.php index 9904045ad1a1..964c7ed0ac2c 100644 --- a/CRM/Core/Error/Log.php +++ b/CRM/Core/Error/Log.php @@ -52,7 +52,7 @@ public static function getMap():array { * @param string $message * @param array $context */ - public function log($level, $message, array $context = []) { + public function log($level, $message, array $context = []): void { // FIXME: This flattens a $context a bit prematurely. When integrating // with external/CMS logs, we should pass through $context. if (!empty($context)) { diff --git a/CRM/Utils/EchoLogger.php b/CRM/Utils/EchoLogger.php index c6db7c04b7f5..1bad4ae9eaac 100644 --- a/CRM/Utils/EchoLogger.php +++ b/CRM/Utils/EchoLogger.php @@ -23,7 +23,7 @@ class CRM_Utils_EchoLogger extends Psr\Log\AbstractLogger implements \Psr\Log\Lo * @param string $message * @param array $context */ - public function log($level, $message, array $context = []) { + public function log($level, $message, array $context = []): void { echo $message . "\n"; } diff --git a/CRM/Utils/SystemLogger.php b/CRM/Utils/SystemLogger.php index eefdaffe5c06..25d7356ae228 100644 --- a/CRM/Utils/SystemLogger.php +++ b/CRM/Utils/SystemLogger.php @@ -23,7 +23,7 @@ class CRM_Utils_SystemLogger extends Psr\Log\AbstractLogger implements \Psr\Log\ * @param string $message * @param array $context */ - public function log($level, $message, array $context = []) { + public function log($level, $message, array $context = []): void { if (!isset($context['hostname'])) { $context['hostname'] = CRM_Utils_System::ipAddress(); } diff --git a/Civi/Api4/Action/System/RotateKey.php b/Civi/Api4/Action/System/RotateKey.php index c904a2c0e4bc..7afc9b204ee0 100644 --- a/Civi/Api4/Action/System/RotateKey.php +++ b/Civi/Api4/Action/System/RotateKey.php @@ -60,7 +60,7 @@ public function _run(Result $result) { * @param string $message * @param array $context */ - public function log($level, $message, array $context = []) { + public function log($level, $message, array $context = []): void { $evalVar = function($m) use ($context) { return $context[$m[1]] ?? ''; }; diff --git a/composer.json b/composer.json index e2edf902b4bb..43f5f96eff17 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "symfony/filesystem": "~3.0 || ~4.4", "symfony/process": "~3.0 || ~4.4", "symfony/var-dumper": "~3.0 || ~4.4 || ~5.1", - "psr/log": "~1.0", + "psr/log": "~1.0 || ~2.0 || ~3.0", "symfony/finder": "~3.0 || ~4.4", "tecnickcom/tcpdf" : "6.4.*", "totten/ca-config": "~22.05",