Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-17 19:26:27 +0300
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-24 18:21:25 +0300
commitea23523c70ee562092510ccf88e7aa469aae9ce6 (patch)
treeda0ce15036d2f7b82ef1a0e44adb497c8e951cb3 /apps/files
parenteb961e47003ee5b6d7328caf10ecd5f53cc93666 (diff)
Adapt more code to migration to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/lib/BackgroundJob/ScanFiles.php15
-rw-r--r--apps/files/lib/Command/Scan.php3
-rw-r--r--apps/files/lib/Command/ScanAppData.php3
3 files changed, 8 insertions, 13 deletions
diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php
index 84846b9b55d..07794a28774 100644
--- a/apps/files/lib/BackgroundJob/ScanFiles.php
+++ b/apps/files/lib/BackgroundJob/ScanFiles.php
@@ -29,7 +29,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IDBConnection;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
/**
* Class ScanFiles is a background job used to run the file scanner over the user
@@ -42,23 +42,16 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
private $config;
/** @var IEventDispatcher */
private $dispatcher;
- /** @var ILogger */
- private $logger;
+ private LoggerInterface $logger;
private $connection;
/** Amount of users that should get scanned per execution */
public const USERS_PER_SESSION = 500;
- /**
- * @param IConfig $config
- * @param IEventDispatcher $dispatcher
- * @param ILogger $logger
- * @param IDBConnection $connection
- */
public function __construct(
IConfig $config,
IEventDispatcher $dispatcher,
- ILogger $logger,
+ LoggerInterface $logger,
IDBConnection $connection
) {
// Run once per 10 minutes
@@ -83,7 +76,7 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
);
$scanner->backgroundScan('');
} catch (\Exception $e) {
- $this->logger->logException($e, ['app' => 'files']);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => 'files']);
}
\OC_Util::tearDownFS();
}
diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php
index ff96fbf2dab..47f1caabc78 100644
--- a/apps/files/lib/Command/Scan.php
+++ b/apps/files/lib/Command/Scan.php
@@ -43,6 +43,7 @@ use OCP\Files\Mount\IMountPoint;
use OCP\Files\NotFoundException;
use OCP\Files\StorageNotAvailableException;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -111,7 +112,7 @@ class Scan extends Base {
$user,
new ConnectionAdapter($connection),
\OC::$server->query(IEventDispatcher::class),
- \OC::$server->getLogger()
+ \OC::$server->get(LoggerInterface::class)
);
# check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception
diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php
index 59281b52bc4..a5e9d99f804 100644
--- a/apps/files/lib/Command/ScanAppData.php
+++ b/apps/files/lib/Command/ScanAppData.php
@@ -38,6 +38,7 @@ use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\Files\StorageNotAvailableException;
use OCP\IConfig;
+use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -95,7 +96,7 @@ class ScanAppData extends Base {
null,
new ConnectionAdapter($connection),
\OC::$server->query(IEventDispatcher::class),
- \OC::$server->getLogger()
+ \OC::$server->get(LoggerInterface::class)
);
# check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception