aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Updater.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-04-16 14:26:43 +0200
committerJoas Schilling <coding@schilljs.com>2021-04-27 14:34:32 +0200
commit56ae87c281d2f54b23f98acf0e138d8e72196a06 (patch)
treed875702c4eb0901bcf6d3e23570a05ba5c397954 /lib/private/Updater.php
parentbf1c875425e7fdf5ffd3c233ddf1f567428b4168 (diff)
downloadnextcloud-server-56ae87c281d2f54b23f98acf0e138d8e72196a06.tar.gz
nextcloud-server-56ae87c281d2f54b23f98acf0e138d8e72196a06.zip
Less ILogger
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Updater.php')
-rw-r--r--lib/private/Updater.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/lib/private/Updater.php b/lib/private/Updater.php
index 78c652b6ee4..964fd2ad102 100644
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -59,7 +59,7 @@ use Symfony\Component\EventDispatcher\GenericEvent;
*/
class Updater extends BasicEmitter {
- /** @var ILogger $log */
+ /** @var LoggerInterface */
private $log;
/** @var IConfig */
@@ -79,15 +79,9 @@ class Updater extends BasicEmitter {
4 => 'Fatal',
];
- /**
- * @param IConfig $config
- * @param Checker $checker
- * @param ILogger $log
- * @param Installer $installer
- */
public function __construct(IConfig $config,
Checker $checker,
- ILogger $log = null,
+ ?LoggerInterface $log,
Installer $installer) {
$this->log = $log;
$this->config = $config;
@@ -132,11 +126,15 @@ class Updater extends BasicEmitter {
try {
$this->doUpgrade($currentVersion, $installedVersion);
} catch (HintException $exception) {
- $this->log->logException($exception, ['app' => 'core']);
+ $this->log->error($exception->getMessage(), [
+ 'exception' => $exception,
+ ]);
$this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' .$exception->getHint()]);
$success = false;
} catch (\Exception $exception) {
- $this->log->logException($exception, ['app' => 'core']);
+ $this->log->error($exception->getMessage(), [
+ 'exception' => $exception,
+ ]);
$this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' .$exception->getMessage()]);
$success = false;
}
@@ -272,7 +270,10 @@ class Updater extends BasicEmitter {
$errors = Installer::installShippedApps(true);
foreach ($errors as $appId => $exception) {
/** @var \Exception $exception */
- $this->log->logException($exception, ['app' => $appId]);
+ $this->log->error($exception->getMessage(), [
+ 'exception' => $exception,
+ 'app' => $appId,
+ ]);
$this->emit('\OC\Updater', 'failure', [$appId . ': ' . $exception->getMessage()]);
}
@@ -424,7 +425,9 @@ class Updater extends BasicEmitter {
$ocApp->enable($app);
}
} catch (\Exception $ex) {
- $this->log->logException($ex, ['app' => 'core']);
+ $this->log->error($ex->getMessage(), [
+ 'exception' => $ex,
+ ]);
}
}
}