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:
authorPatrik Kernstock <info@pkern.at>2018-10-05 22:09:13 +0300
committerPatrik Kernstock <info@pkern.at>2018-10-05 22:09:13 +0300
commit1973556346c4c0550aec1b7b38727ea89416bbeb (patch)
tree53373924f951770c18622f1945bf4a19d841ac11 /core/Command
parentf27ce6b5a0efaf2f7a5f4942cccd6186f439ed42 (diff)
Log exception using ILogger
Signed-off-by: Patrik Kernstock <info@pkern.at>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/App/Remove.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/Command/App/Remove.php b/core/Command/App/Remove.php
index d14a3c6e090..dc8ea7c2203 100644
--- a/core/Command/App/Remove.php
+++ b/core/Command/App/Remove.php
@@ -24,6 +24,7 @@ namespace OC\Core\Command\App;
use OC\Installer;
use OCP\App\IAppManager;
+use OCP\ILogger;
use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Command\Command;
@@ -38,15 +39,19 @@ class Remove extends Command implements CompletionAwareInterface {
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) {
+ public function __construct(IAppManager $manager, Installer $installer, ILogger $logger) {
parent::__construct();
$this->manager = $manager;
$this->installer = $installer;
+ $this->logger = $logger;
}
protected function configure() {
@@ -90,6 +95,10 @@ class Remove extends Command implements CompletionAwareInterface {
$output->writeln($appId . ' disabled');
} catch(\Exception $e) {
$output->writeln('Error: ' . $e->getMessage());
+ $this->logger->logException($e, [
+ 'app' => 'CLI',
+ 'level' => ILogger::ERROR
+ ]);
return 1;
}
}
@@ -99,6 +108,10 @@ class Remove extends Command implements CompletionAwareInterface {
$result = $this->installer->removeApp($appId);
} catch(\Exception $e) {
$output->writeln('Error: ' . $e->getMessage());
+ $this->logger->logException($e, [
+ 'app' => 'CLI',
+ 'level' => ILogger::ERROR
+ ]);
return 1;
}