diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-12 17:14:25 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-10-12 22:07:04 +0200 |
commit | 49ff48fcd3f07c229a0439748cb1469e5d11c504 (patch) | |
tree | b6fb0e531e0b36920700124040056b92882263ae /lib/private/Authentication/TwoFactorAuth/Manager.php | |
parent | deb499d34e7e4760db22d250b4cb1449e981d98c (diff) | |
download | nextcloud-server-49ff48fcd3f07c229a0439748cb1469e5d11c504.tar.gz nextcloud-server-49ff48fcd3f07c229a0439748cb1469e5d11c504.zip |
Use PSR logger in authentication
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Authentication/TwoFactorAuth/Manager.php')
-rw-r--r-- | lib/private/Authentication/TwoFactorAuth/Manager.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index 07e61175361..8e529ccbda8 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -27,8 +27,6 @@ declare(strict_types=1); namespace OC\Authentication\TwoFactorAuth; -use function array_diff; -use function array_filter; use BadMethodCallException; use Exception; use OC\Authentication\Exceptions\InvalidTokenException; @@ -39,11 +37,13 @@ use OCP\Authentication\TwoFactorAuth\IActivatableAtLogin; use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\IConfig; -use OCP\ILogger; use OCP\ISession; use OCP\IUser; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; +use function array_diff; +use function array_filter; class Manager { public const SESSION_UID_KEY = 'two_factor_auth_uid'; @@ -69,7 +69,7 @@ class Manager { /** @var IManager */ private $activityManager; - /** @var ILogger */ + /** @var LoggerInterface */ private $logger; /** @var TokenProvider */ @@ -84,9 +84,13 @@ class Manager { public function __construct(ProviderLoader $providerLoader, IRegistry $providerRegistry, MandatoryTwoFactor $mandatoryTwoFactor, - ISession $session, IConfig $config, - IManager $activityManager, ILogger $logger, TokenProvider $tokenProvider, - ITimeFactory $timeFactory, EventDispatcherInterface $eventDispatcher) { + ISession $session, + IConfig $config, + IManager $activityManager, + LoggerInterface $logger, + TokenProvider $tokenProvider, + ITimeFactory $timeFactory, + EventDispatcherInterface $eventDispatcher) { $this->providerLoader = $providerLoader; $this->providerRegistry = $providerRegistry; $this->mandatoryTwoFactor = $mandatoryTwoFactor; @@ -295,8 +299,7 @@ class Manager { try { $this->activityManager->publish($activity); } catch (BadMethodCallException $e) { - $this->logger->warning('could not publish activity', ['app' => 'core']); - $this->logger->logException($e, ['app' => 'core']); + $this->logger->warning('could not publish activity', ['app' => 'core', 'exception' => $e]); } } |