diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-10-03 17:03:53 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-10-04 16:07:08 +0300 |
commit | 759a3a70eb015564b4633d08454acfd21d499142 (patch) | |
tree | c4efcea69fa67737eb30c0c484e882685be8811b /lib | |
parent | 2177092693588e9d6adbfe842caa191352634742 (diff) |
Migrate controllers to the PSR logger interface
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/AccountsController.php | 8 | ||||
-rwxr-xr-x | lib/Controller/MessagesController.php | 8 | ||||
-rw-r--r-- | lib/Controller/PageController.php | 11 |
3 files changed, 13 insertions, 14 deletions
diff --git a/lib/Controller/AccountsController.php b/lib/Controller/AccountsController.php index 4e0005738..c51c7aaab 100644 --- a/lib/Controller/AccountsController.php +++ b/lib/Controller/AccountsController.php @@ -48,8 +48,8 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\IL10N; -use OCP\ILogger; use OCP\IRequest; +use Psr\Log\LoggerInterface; class AccountsController extends Controller { @@ -62,7 +62,7 @@ class AccountsController extends Controller { /** @var string */ private $currentUserId; - /** @var ILogger */ + /** @var LoggerInterface */ private $logger; /** @var IL10N */ @@ -91,7 +91,7 @@ class AccountsController extends Controller { * @param AccountService $accountService * @param GroupsIntegration $groupsIntegration * @param $UserId - * @param ILogger $logger + * @param LoggerInterface $logger * @param IL10N $l10n * @param AliasesService $aliasesService * @param IMailTransmission $mailTransmission @@ -104,7 +104,7 @@ class AccountsController extends Controller { AccountService $accountService, GroupsIntegration $groupsIntegration, $UserId, - ILogger $logger, + LoggerInterface $logger, IL10N $l10n, AliasesService $aliasesService, IMailTransmission $mailTransmission, diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php index ba284e76c..10a64502a 100755 --- a/lib/Controller/MessagesController.php +++ b/lib/Controller/MessagesController.php @@ -50,9 +50,9 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\Files\Folder; use OCP\Files\IMimeTypeDetector; use OCP\IL10N; -use OCP\ILogger; use OCP\IRequest; use OCP\IURLGenerator; +use Psr\Log\LoggerInterface; use function array_map; class MessagesController extends Controller { @@ -72,7 +72,7 @@ class MessagesController extends Controller { /** @var string */ private $currentUserId; - /** @var ILogger */ + /** @var LoggerInterface */ private $logger; /** @var Folder */ @@ -93,7 +93,7 @@ class MessagesController extends Controller { * @param AccountService $accountService * @param string $UserId * @param $userFolder - * @param ILogger $logger + * @param LoggerInterface $logger * @param IL10N $l10n * @param IMimeTypeDetector $mimeTypeDetector * @param IURLGenerator $urlGenerator @@ -106,7 +106,7 @@ class MessagesController extends Controller { ItineraryService $itineraryService, string $UserId, $userFolder, - ILogger $logger, + LoggerInterface $logger, IL10N $l10n, IMimeTypeDetector $mimeTypeDetector, IURLGenerator $urlGenerator) { diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 6ec957773..ce67d0300 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -38,10 +38,10 @@ use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\IInitialStateService; -use OCP\ILogger; use OCP\IRequest; use OCP\IURLGenerator; use OCP\IUserSession; +use Psr\Log\LoggerInterface; class PageController extends Controller { @@ -72,7 +72,7 @@ class PageController extends Controller { /** @var IInitialStateService */ private $initialStateService; - /** @var ILogger */ + /** @var LoggerInterface */ private $logger; public function __construct(string $appName, @@ -86,7 +86,7 @@ class PageController extends Controller { IUserPreferences $preferences, IMailManager $mailManager, IInitialStateService $initialStateService, - ILogger $logger) { + LoggerInterface $logger) { parent::__construct($appName, $request); $this->urlGenerator = $urlGenerator; @@ -119,9 +119,8 @@ class PageController extends Controller { $mailboxes = $this->mailManager->getMailboxes($mailAccount); $json['mailboxes'] = $mailboxes; } catch (Exception $ex) { - $this->logger->logException($ex, [ - 'message' => 'Could not load account mailboxes: ' . $ex->getMessage(), - 'level' => ILogger::FATAL, + $this->logger->critical('Could not load account mailboxes: ' . $ex->getMessage(), [ + 'exception' => $ex, ]); $json['mailboxes'] = []; $json['error'] = true; |