summaryrefslogtreecommitdiffstats
path: root/lib/private/App/AppStore/Fetcher
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/App/AppStore/Fetcher')
-rw-r--r--lib/private/App/AppStore/Fetcher/AppFetcher.php17
-rw-r--r--lib/private/App/AppStore/Fetcher/CategoryFetcher.php11
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php18
3 files changed, 15 insertions, 31 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php
index 416e55463cf..cd6b005c0d1 100644
--- a/lib/private/App/AppStore/Fetcher/AppFetcher.php
+++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php
@@ -37,6 +37,7 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class AppFetcher extends Fetcher {
@@ -46,20 +47,12 @@ class AppFetcher extends Fetcher {
/** @var bool */
private $ignoreMaxVersion;
- /**
- * @param Factory $appDataFactory
- * @param IClientService $clientService
- * @param ITimeFactory $timeFactory
- * @param IConfig $config
- * @param CompareVersion $compareVersion
- * @param ILogger $logger
- */
public function __construct(Factory $appDataFactory,
IClientService $clientService,
ITimeFactory $timeFactory,
IConfig $config,
CompareVersion $compareVersion,
- ILogger $logger) {
+ LoggerInterface $logger) {
parent::__construct(
$appDataFactory,
$clientService,
@@ -86,7 +79,7 @@ class AppFetcher extends Fetcher {
protected function fetch($ETag, $content, $allowUnstable = false) {
/** @var mixed[] $response */
$response = parent::fetch($ETag, $content);
-
+
if (empty($response)) {
return [];
}
@@ -134,7 +127,9 @@ class AppFetcher extends Fetcher {
$releases[] = $release;
}
} catch (\InvalidArgumentException $e) {
- $this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => ILogger::WARN]);
+ $this->logger->warning($e->getMessage(), [
+ 'exception' => $e,
+ ]);
}
}
}
diff --git a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php
index e34fbee8c58..896444a6640 100644
--- a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php
+++ b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php
@@ -31,21 +31,14 @@ use OC\Files\AppData\Factory;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class CategoryFetcher extends Fetcher {
- /**
- * @param Factory $appDataFactory
- * @param IClientService $clientService
- * @param ITimeFactory $timeFactory
- * @param IConfig $config
- * @param ILogger $logger
- */
public function __construct(Factory $appDataFactory,
IClientService $clientService,
ITimeFactory $timeFactory,
IConfig $config,
- ILogger $logger) {
+ LoggerInterface $logger) {
parent::__construct(
$appDataFactory,
$clientService,
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index c5d83fcb1df..24c2fce00f5 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -39,7 +39,7 @@ use OCP\Files\IAppData;
use OCP\Files\NotFoundException;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
abstract class Fetcher {
public const INVALIDATE_AFTER_SECONDS = 3600;
@@ -53,7 +53,7 @@ abstract class Fetcher {
protected $timeFactory;
/** @var IConfig */
protected $config;
- /** @var Ilogger */
+ /** @var LoggerInterface */
protected $logger;
/** @var string */
protected $fileName;
@@ -64,18 +64,11 @@ abstract class Fetcher {
/** @var string */
protected $channel;
- /**
- * @param Factory $appDataFactory
- * @param IClientService $clientService
- * @param ITimeFactory $timeFactory
- * @param IConfig $config
- * @param ILogger $logger
- */
public function __construct(Factory $appDataFactory,
IClientService $clientService,
ITimeFactory $timeFactory,
IConfig $config,
- ILogger $logger) {
+ LoggerInterface $logger) {
$this->appData = $appDataFactory->get('appstore');
$this->clientService = $clientService;
$this->timeFactory = $timeFactory;
@@ -202,7 +195,10 @@ abstract class Fetcher {
$this->logger->warning('Could not connect to appstore: ' . $e->getMessage(), ['app' => 'appstoreFetcher']);
return [];
} catch (\Exception $e) {
- $this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => ILogger::WARN]);
+ $this->logger->warning($e->getMessage(), [
+ 'exception' => $e,
+ 'app' => 'appstoreFetcher',
+ ]);
return [];
}
}