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:
authorVincent Petry <vincent@nextcloud.com>2021-07-20 21:36:26 +0300
committerVincent Petry <vincent@nextcloud.com>2021-07-27 14:04:39 +0300
commitdac676c14ef7a3bd866a674c2ced666435d977c6 (patch)
treeac22860171df795acc5a6234394ec154f2cef638 /apps/files_sharing/lib
parente67e90afce36edb18cebbc5f5799e427b891e114 (diff)
Replace ILogger with LoggerInterface in remote share manager
Signed-off-by: Vincent Petry <vincent@nextcloud.com> Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php3
-rw-r--r--apps/files_sharing/lib/External/Manager.php20
-rw-r--r--apps/files_sharing/lib/Hooks.php3
3 files changed, 14 insertions, 12 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 3975a8a3bde..2dfbe4d86a5 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -60,6 +60,7 @@ use OCP\Share\Events\ShareCreatedEvent;
use OCP\Share\IManager;
use OCP\Util;
use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -99,7 +100,7 @@ class Application extends App {
$server->getUserManager(),
$uid,
$server->query(IEventDispatcher::class),
- $server->getLogger()
+ $server->get(LoggerInterface::class)
);
});
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php
index b74198c8793..a8b01a74464 100644
--- a/apps/files_sharing/lib/External/Manager.php
+++ b/apps/files_sharing/lib/External/Manager.php
@@ -46,12 +46,12 @@ use OCP\Files\Storage\IStorageFactory;
use OCP\Http\Client\IClientService;
use OCP\IDBConnection;
use OCP\IGroupManager;
-use OCP\ILogger;
use OCP\IUserManager;
use OCP\Notification\IManager;
use OCP\OCS\IDiscoveryService;
use OCP\Share;
use OCP\Share\IShare;
+use Psr\Log\LoggerInterface;
class Manager {
public const STORAGE = '\OCA\Files_Sharing\External\Storage';
@@ -92,7 +92,7 @@ class Manager {
/** @var IEventDispatcher */
private $eventDispatcher;
- /** @var ILogger */
+ /** @var LoggerInterface */
private $logger;
public function __construct(
@@ -108,7 +108,7 @@ class Manager {
IUserManager $userManager,
?string $uid,
IEventDispatcher $eventDispatcher,
- ILogger $logger
+ LoggerInterface $logger
) {
$this->connection = $connection;
$this->mountManager = $mountManager;
@@ -343,7 +343,7 @@ class Manager {
$acceptShare->execute([1, $mountPoint, $hash, $subshare['id'], $this->uid]);
$result = true;
} catch (Exception $e) {
- $this->logger->logException($e);
+ $this->logger->emergency('Could not update share', ['exception' => $e]);
$result = false;
}
} else {
@@ -361,7 +361,7 @@ class Manager {
$share['share_type']);
$result = true;
} catch (Exception $e) {
- $this->logger->logException($e);
+ $this->logger->emergency('Could not create share', ['exception' => $e]);
$result = false;
}
}
@@ -412,7 +412,7 @@ class Manager {
$this->updateAccepted((int)$subshare['id'], false);
$result = true;
} catch (Exception $e) {
- $this->logger->logException($e);
+ $this->logger->emergency('Could not update share', ['exception' => $e]);
$result = false;
}
} else {
@@ -432,7 +432,7 @@ class Manager {
$share['share_type']);
$result = true;
} catch (Exception $e) {
- $this->logger->logException($e);
+ $this->logger->emergency('Could not create share', ['exception' => $e]);
$result = false;
}
}
@@ -634,7 +634,7 @@ class Manager {
$this->removeReShares($id);
} catch (\Doctrine\DBAL\Exception $ex) {
- $this->logger->logException($ex);
+ $this->logger->emergency('Could not update share', ['exception' => $ex]);
return false;
}
@@ -706,7 +706,7 @@ class Manager {
$deleteResult->closeCursor();
}
} catch (\Doctrine\DBAL\Exception $ex) {
- $this->logger->logException($ex);
+ $this->logger->emergency('Could not get shares', ['exception' => $ex]);
return false;
}
@@ -784,7 +784,7 @@ class Manager {
}
return array_values($shares);
} catch (\Doctrine\DBAL\Exception $e) {
- $this->logger->logException($e);
+ $this->logger->emergency('Error when retrieving shares', ['exception' => $e]);
return [];
}
}
diff --git a/apps/files_sharing/lib/Hooks.php b/apps/files_sharing/lib/Hooks.php
index 26e799297ff..f28f6910abd 100644
--- a/apps/files_sharing/lib/Hooks.php
+++ b/apps/files_sharing/lib/Hooks.php
@@ -28,6 +28,7 @@ namespace OCA\Files_Sharing;
use OC\Files\Filesystem;
use OCP\EventDispatcher\IEventDispatcher;
+use Psr\Log\LoggerInterface;
class Hooks {
public static function deleteUser($params) {
@@ -44,7 +45,7 @@ class Hooks {
\OC::$server->getUserManager(),
$params['uid'],
\OC::$server->query(IEventDispatcher::class),
- \OC::$server->getLogger()
+ \OC::$server->get(LoggerInterface::class)
);
$manager->removeUserShares($params['uid']);