diff options
Diffstat (limited to 'apps/federatedfilesharing/lib/Notifications.php')
-rw-r--r-- | apps/federatedfilesharing/lib/Notifications.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index 52aa83fad46..181a0994952 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -35,6 +35,7 @@ use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProviderManager; use OCP\Http\Client\IClientService; use OCP\OCS\IDiscoveryService; +use OCP\ILogger; class Notifications { public const RESPONSE_FORMAT = 'json'; // default response format for ocs calls @@ -60,6 +61,9 @@ class Notifications { /** @var IEventDispatcher */ private $eventDispatcher; + /** @var ILogger */ + protected $logger; + public function __construct( AddressHandler $addressHandler, IClientService $httpClientService, @@ -73,6 +77,7 @@ class Notifications { $this->httpClientService = $httpClientService; $this->discoveryService = $discoveryService; $this->jobList = $jobList; + $this->logger = OC::$server->getLogger(); $this->federationProviderManager = $federationProviderManager; $this->cloudFederationFactory = $cloudFederationFactory; $this->eventDispatcher = $eventDispatcher; @@ -124,13 +129,13 @@ class Notifications { $this->eventDispatcher->dispatchTyped($event); return true; } else { - \OC::$server->getLogger()->info( + $this->logger->info( "failed sharing $name with $shareWith", ['app' => 'federatedfilesharing'] ); } } else { - \OC::$server->getLogger()->info( + $this->logger->info( "could not share $name, invalid contact $shareWith", ['app' => 'federatedfilesharing'] ); @@ -185,17 +190,17 @@ class Notifications { $status['ocs']['data']['remoteId'] ]; } elseif (!$validToken) { - \OC::$server->getLogger()->info( + $this->logger->info( "invalid or missing token requesting re-share for $filename to $remote", ['app' => 'federatedfilesharing'] ); } elseif (!$validRemoteId) { - \OC::$server->getLogger()->info( + $this->logger->info( "missing remote id requesting re-share for $filename to $remote", ['app' => 'federatedfilesharing'] ); } else { - \OC::$server->getLogger()->info( + $this->logger->info( "failed requesting re-share for $filename to $remote", ['app' => 'federatedfilesharing'] ); |