summaryrefslogtreecommitdiffstats
path: root/core/Command/App/Remove.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/App/Remove.php')
-rw-r--r--core/Command/App/Remove.php27
1 files changed, 9 insertions, 18 deletions
diff --git a/core/Command/App/Remove.php b/core/Command/App/Remove.php
index 101c8235187..2aa453132e4 100644
--- a/core/Command/App/Remove.php
+++ b/core/Command/App/Remove.php
@@ -28,7 +28,7 @@ namespace OC\Core\Command\App;
use OC\Installer;
use OCP\App\IAppManager;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Command\Command;
@@ -39,20 +39,11 @@ use Symfony\Component\Console\Output\OutputInterface;
use Throwable;
class Remove extends Command implements CompletionAwareInterface {
+ protected IAppManager $manager;
+ private Installer $installer;
+ private LoggerInterface $logger;
- /** @var IAppManager */
- protected $manager;
- /** @var Installer */
- private $installer;
- /** @var ILogger */
- private $logger;
-
- /**
- * @param IAppManager $manager
- * @param Installer $installer
- * @param ILogger $logger
- */
- public function __construct(IAppManager $manager, Installer $installer, ILogger $logger) {
+ public function __construct(IAppManager $manager, Installer $installer, LoggerInterface $logger) {
parent::__construct();
$this->manager = $manager;
$this->installer = $installer;
@@ -100,9 +91,9 @@ class Remove extends Command implements CompletionAwareInterface {
$output->writeln($appId . ' disabled');
} catch (Throwable $e) {
$output->writeln('<error>Error: ' . $e->getMessage() . '</error>');
- $this->logger->logException($e, [
+ $this->logger->error($e->getMessage(), [
'app' => 'CLI',
- 'level' => ILogger::ERROR
+ 'exception' => $e,
]);
return 1;
}
@@ -113,9 +104,9 @@ class Remove extends Command implements CompletionAwareInterface {
$result = $this->installer->removeApp($appId);
} catch (Throwable $e) {
$output->writeln('<error>Error: ' . $e->getMessage() . '</error>');
- $this->logger->logException($e, [
+ $this->logger->error($e->getMessage(), [
'app' => 'CLI',
- 'level' => ILogger::ERROR
+ 'exception' => $e,
]);
return 1;
}