summaryrefslogtreecommitdiffstats
path: root/lib/private/Route
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-17 16:42:53 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-24 16:21:25 +0100
commit6be7aa112f6174c1406cfef5449836124a7f6f50 (patch)
tree5029bf9659caeab8702e9fabbbdeb9a2cd849bfa /lib/private/Route
parentfbf1334dc8c192ebdd335663cacfb810daf4d841 (diff)
downloadnextcloud-server-6be7aa112f6174c1406cfef5449836124a7f6f50.tar.gz
nextcloud-server-6be7aa112f6174c1406cfef5449836124a7f6f50.zip
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Route')
-rw-r--r--lib/private/Route/CachingRouter.php5
-rw-r--r--lib/private/Route/Router.php12
2 files changed, 6 insertions, 11 deletions
diff --git a/lib/private/Route/CachingRouter.php b/lib/private/Route/CachingRouter.php
index 553ea285fd4..f65060e710b 100644
--- a/lib/private/Route/CachingRouter.php
+++ b/lib/private/Route/CachingRouter.php
@@ -24,7 +24,7 @@
*/
namespace OC\Route;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class CachingRouter extends Router {
/**
@@ -34,9 +34,8 @@ class CachingRouter extends Router {
/**
* @param \OCP\ICache $cache
- * @param ILogger $logger
*/
- public function __construct($cache, ILogger $logger) {
+ public function __construct($cache, LoggerInterface $logger) {
$this->cache = $cache;
parent::__construct($logger);
}
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index fcde8f08897..b957173cacc 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -34,9 +34,9 @@ namespace OC\Route;
use OC\AppFramework\Routing\RouteParser;
use OCP\AppFramework\App;
-use OCP\ILogger;
use OCP\Route\IRouter;
use OCP\Util;
+use Psr\Log\LoggerInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Generator\UrlGenerator;
@@ -61,15 +61,11 @@ class Router implements IRouter {
protected $loaded = false;
/** @var array */
protected $loadedApps = [];
- /** @var ILogger */
- protected $logger;
+ protected LoggerInterface $logger;
/** @var RequestContext */
protected $context;
- /**
- * @param ILogger $logger
- */
- public function __construct(ILogger $logger) {
+ public function __construct(LoggerInterface $logger) {
$this->logger = $logger;
$baseUrl = \OC::$WEBROOT;
if (!(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) {
@@ -364,7 +360,7 @@ class Router implements IRouter {
try {
return $this->getGenerator()->generate($name, $parameters, $referenceType);
} catch (RouteNotFoundException $e) {
- $this->logger->logException($e, ['level' => ILogger::INFO]);
+ $this->logger->info($e->getMessage(), ['exception' => $e]);
return '';
}
}