summaryrefslogtreecommitdiffstats
path: root/lib/private/User
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/User
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/User')
-rw-r--r--lib/private/User/Session.php24
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index cd26337cd20..365a01c4595 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -54,7 +54,6 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\NotPermittedException;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\ISession;
use OCP\IUser;
@@ -64,6 +63,7 @@ use OCP\Security\ISecureRandom;
use OCP\Session\Exceptions\SessionNotAvailableException;
use OCP\User\Events\PostLoginEvent;
use OCP\Util;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
/**
@@ -114,21 +114,10 @@ class Session implements IUserSession, Emitter {
/** @var ILockdownManager */
private $lockdownManager;
- /** @var ILogger */
- private $logger;
+ private LoggerInterface $logger;
/** @var IEventDispatcher */
private $dispatcher;
- /**
- * @param Manager $manager
- * @param ISession $session
- * @param ITimeFactory $timeFactory
- * @param IProvider|null $tokenProvider
- * @param IConfig $config
- * @param ISecureRandom $random
- * @param ILockdownManager $lockdownManager
- * @param ILogger $logger
- */
public function __construct(Manager $manager,
ISession $session,
ITimeFactory $timeFactory,
@@ -136,7 +125,7 @@ class Session implements IUserSession, Emitter {
IConfig $config,
ISecureRandom $random,
ILockdownManager $lockdownManager,
- ILogger $logger,
+ LoggerInterface $logger,
IEventDispatcher $dispatcher
) {
$this->manager = $manager;
@@ -533,9 +522,8 @@ class Session implements IUserSession, Emitter {
} catch (ExpiredTokenException $e) {
throw $e;
} catch (InvalidTokenException $ex) {
- $this->logger->logException($ex, [
- 'level' => ILogger::DEBUG,
- 'message' => 'Token is not valid: ' . $ex->getMessage(),
+ $this->logger->debug('Token is not valid: ' . $ex->getMessage(), [
+ 'exception' => $ex,
]);
return false;
}
@@ -890,7 +878,7 @@ class Session implements IUserSession, Emitter {
} catch (SessionNotAvailableException $ex) {
return false;
} catch (InvalidTokenException $ex) {
- \OC::$server->getLogger()->warning('Renewing session token failed', ['app' => 'core']);
+ $this->logger->warning('Renewing session token failed', ['app' => 'core']);
return false;
}