aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-11 21:52:33 +0200
committerGitHub <noreply@github.com>2017-05-11 21:52:33 +0200
commitd83f1d96d4541e8e5a686be94b9c03ebb31f5f76 (patch)
tree31b6d45430a590e6ebd96255ac8b28e42b333509
parent23b6f0e4d72f0a70eec9b4ba69ba9e5a0cb72731 (diff)
parentcaa0ae94e8a26a05df8542d29164b610bf031eac (diff)
downloadnextcloud-server-d83f1d96d4541e8e5a686be94b9c03ebb31f5f76.tar.gz
nextcloud-server-d83f1d96d4541e8e5a686be94b9c03ebb31f5f76.zip
Merge pull request #4817 from nextcloud/more-app-update-logs
Proper logging for appstore updates
-rw-r--r--core/Command/Upgrade.php8
-rw-r--r--core/ajax/update.php9
-rw-r--r--lib/private/Updater.php10
3 files changed, 25 insertions, 2 deletions
diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php
index 2e518f52e21..abc37527d2a 100644
--- a/core/Command/Upgrade.php
+++ b/core/Command/Upgrade.php
@@ -220,8 +220,14 @@ class Upgrade extends Command {
$updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($output) {
$output->writeln('<comment>Disabled 3rd-party app: ' . $app . '</comment>');
});
+ $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($output) {
+ $output->writeln('<info>Checking for update of app ' . $app . ' in appstore</info>');
+ });
$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($output) {
- $output->writeln('<info>Update 3rd-party app: ' . $app . '</info>');
+ $output->writeln('<info>Update app ' . $app . ' from appstore</info>');
+ });
+ $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($output) {
+ $output->writeln('<info>Checked for update of app "' . $app . '" in appstore </info>');
});
$updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($output) {
$output->writeln('<info>Checking updates of apps</info>');
diff --git a/core/ajax/update.php b/core/ajax/update.php
index 37abdc5dc3b..d23e3b0d56d 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -160,6 +160,15 @@ if (OC::checkUpgrade(false)) {
$updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Checking updates of apps'));
});
+ $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) {
+ $eventSource->send('success', (string)$l->t('Checking for update of app "%s" in appstore', [$app]));
+ });
+ $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) {
+ $eventSource->send('success', (string)$l->t('Update app "%s" from appstore', [$app]));
+ });
+ $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) {
+ $eventSource->send('success', (string)$l->t('Checked for update of app "%s" in appstore', [$app]));
+ });
$updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
});
diff --git a/lib/private/Updater.php b/lib/private/Updater.php
index 023b3e6972c..6f81e6175f3 100644
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -447,10 +447,12 @@ class Updater extends BasicEmitter {
$this->log,
\OC::$server->getConfig()
);
+ $this->emit('\OC\Updater', 'checkAppStoreAppBefore', [$app]);
if (Installer::isUpdateAvailable($app, \OC::$server->getAppFetcher())) {
$this->emit('\OC\Updater', 'upgradeAppStoreApp', [$app]);
$installer->updateAppstoreApp($app);
}
+ $this->emit('\OC\Updater', 'checkAppStoreApp', [$app]);
} catch (\Exception $ex) {
$this->log->logException($ex, ['app' => 'core']);
}
@@ -578,8 +580,14 @@ class Updater extends BasicEmitter {
$this->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($log) {
$log->info('\OC\Updater::thirdPartyAppDisabled: Disabled 3rd-party app: ' . $app, ['app' => 'updater']);
});
+ $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($log) {
+ $log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "' . $app . '" in appstore', ['app' => 'updater']);
+ });
$this->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($log) {
- $log->info('\OC\Updater::upgradeAppStoreApp: Update 3rd-party app: ' . $app, ['app' => 'updater']);
+ $log->info('\OC\Updater::upgradeAppStoreApp: Update app "' . $app . '" from appstore', ['app' => 'updater']);
+ });
+ $this->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($log) {
+ $log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "' . $app . '" in appstore', ['app' => 'updater']);
});
$this->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($log) {
$log->info('\OC\Updater::appUpgradeCheckBefore: Checking updates of apps', ['app' => 'updater']);