summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup
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/Setup
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/Setup')
-rw-r--r--lib/private/Setup/AbstractDatabase.php6
-rw-r--r--lib/private/Setup/MySQL.php15
2 files changed, 9 insertions, 12 deletions
diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php
index 77f3c02f9f6..5b975bcfcca 100644
--- a/lib/private/Setup/AbstractDatabase.php
+++ b/lib/private/Setup/AbstractDatabase.php
@@ -34,8 +34,8 @@ use OC\DB\ConnectionFactory;
use OC\DB\MigrationService;
use OC\SystemConfig;
use OCP\IL10N;
-use OCP\ILogger;
use OCP\Security\ISecureRandom;
+use Psr\Log\LoggerInterface;
abstract class AbstractDatabase {
@@ -55,12 +55,12 @@ abstract class AbstractDatabase {
protected $tablePrefix;
/** @var SystemConfig */
protected $config;
- /** @var ILogger */
+ /** @var LoggerInterface */
protected $logger;
/** @var ISecureRandom */
protected $random;
- public function __construct(IL10N $trans, SystemConfig $config, ILogger $logger, ISecureRandom $random) {
+ public function __construct(IL10N $trans, SystemConfig $config, LoggerInterface $logger, ISecureRandom $random) {
$this->trans = $trans;
$this->config = $config;
$this->logger = $logger;
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 229d47160f5..c2b0cd8aaac 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -84,9 +84,8 @@ class MySQL extends AbstractDatabase {
$query = "CREATE DATABASE IF NOT EXISTS `$name` CHARACTER SET $characterSet COLLATE ${characterSet}_bin;";
$connection->executeUpdate($query);
} catch (\Exception $ex) {
- $this->logger->logException($ex, [
- 'message' => 'Database creation failed.',
- 'level' => ILogger::ERROR,
+ $this->logger->error('Database creation failed.', [
+ 'exception' => $ex,
'app' => 'mysql.setup',
]);
return;
@@ -97,9 +96,8 @@ class MySQL extends AbstractDatabase {
$query = "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `$name` . * TO '$user'";
$connection->executeUpdate($query);
} catch (\Exception $ex) {
- $this->logger->logException($ex, [
- 'message' => 'Could not automatically grant privileges, this can be ignored if database user already had privileges.',
- 'level' => ILogger::DEBUG,
+ $this->logger->debug('Could not automatically grant privileges, this can be ignored if database user already had privileges.', [
+ 'exception' => $ex,
'app' => 'mysql.setup',
]);
}
@@ -128,9 +126,8 @@ class MySQL extends AbstractDatabase {
$connection->executeUpdate($query);
}
} catch (\Exception $ex) {
- $this->logger->logException($ex, [
- 'message' => 'Database user creation failed.',
- 'level' => ILogger::ERROR,
+ $this->logger->error('Database user creation failed.',[
+ 'exception' => $ex,
'app' => 'mysql.setup',
]);
}