summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Cache/Scanner.php5
-rw-r--r--lib/private/Files/Filesystem.php5
-rw-r--r--lib/private/Files/Mount/MountPoint.php5
-rw-r--r--lib/private/Files/Mount/ObjectHomeMountProvider.php5
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php3
-rw-r--r--lib/private/Files/Storage/Common.php3
-rw-r--r--lib/private/Files/Storage/DAV.php3
-rw-r--r--lib/private/Files/Storage/Local.php9
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php2
-rw-r--r--lib/private/Files/View.php9
10 files changed, 29 insertions, 20 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 8f5f09319dd..e148a25accd 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -38,6 +38,7 @@ use OC\Files\Filesystem;
use OC\Hooks\BasicEmitter;
use OCP\Files\Cache\IScanner;
use OCP\Files\ForbiddenException;
+use OCP\ILogger;
use OCP\Lock\ILockingProvider;
/**
@@ -110,7 +111,7 @@ class Scanner extends BasicEmitter implements IScanner {
protected function getData($path) {
$data = $this->storage->getMetaData($path);
if (is_null($data)) {
- \OCP\Util::writeLog(Scanner::class, "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG);
+ \OCP\Util::writeLog(Scanner::class, "!!! Path '$path' is not accessible or present !!!", ILogger::DEBUG);
}
return $data;
}
@@ -454,7 +455,7 @@ class Scanner extends BasicEmitter implements IScanner {
}
\OC::$server->getLogger()->logException($ex, [
'message' => 'Exception while scanning file "' . $child . '"',
- 'level' => \OCP\Util::DEBUG,
+ 'level' => ILogger::DEBUG,
'app' => 'core',
]);
$exceptionOccurred = true;
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index b9f0813c84a..12e59e5ba2d 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -65,6 +65,7 @@ use OC\Files\Storage\StorageFactory;
use OC\Lockdown\Filesystem\NullStorage;
use OCP\Files\Config\IMountProvider;
use OCP\Files\NotFoundException;
+use OCP\ILogger;
use OCP\IUserManager;
class Filesystem {
@@ -408,7 +409,7 @@ class Filesystem {
$userObject = $userManager->get($user);
if (is_null($userObject)) {
- \OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, \OCP\Util::ERROR);
+ \OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, ILogger::ERROR);
// reset flag, this will make it possible to rethrow the exception if called again
unset(self::$usersSetup[$user]);
throw new \OC\User\NoUserException('Backends provided no user object for ' . $user);
@@ -418,7 +419,7 @@ class Filesystem {
// workaround in case of different casings
if ($user !== $realUid) {
$stack = json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 50));
- \OCP\Util::writeLog('files', 'initMountPoints() called with wrong user casing. This could be a bug. Expected: "' . $realUid . '" got "' . $user . '". Stack: ' . $stack, \OCP\Util::WARN);
+ \OCP\Util::writeLog('files', 'initMountPoints() called with wrong user casing. This could be a bug. Expected: "' . $realUid . '" got "' . $user . '". Stack: ' . $stack, ILogger::WARN);
$user = $realUid;
// again with the correct casing
diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php
index 26150de2bd1..36e10bfb45a 100644
--- a/lib/private/Files/Mount/MountPoint.php
+++ b/lib/private/Files/Mount/MountPoint.php
@@ -33,6 +33,7 @@ use \OC\Files\Filesystem;
use OC\Files\Storage\StorageFactory;
use OC\Files\Storage\Storage;
use OCP\Files\Mount\IMountPoint;
+use OCP\ILogger;
class MountPoint implements IMountPoint {
/**
@@ -152,12 +153,12 @@ class MountPoint implements IMountPoint {
// the root storage could not be initialized, show the user!
throw new \Exception('The root storage could not be initialized. Please contact your local administrator.', $exception->getCode(), $exception);
} else {
- \OC::$server->getLogger()->logException($exception, ['level' => \OCP\Util::ERROR]);
+ \OC::$server->getLogger()->logException($exception, ['level' => ILogger::ERROR]);
}
return;
}
} else {
- \OCP\Util::writeLog('core', 'storage backend ' . $this->class . ' not found', \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', 'storage backend ' . $this->class . ' not found', ILogger::ERROR);
$this->invalidStorage = true;
return;
}
diff --git a/lib/private/Files/Mount/ObjectHomeMountProvider.php b/lib/private/Files/Mount/ObjectHomeMountProvider.php
index 9c09c0737c8..62669020884 100644
--- a/lib/private/Files/Mount/ObjectHomeMountProvider.php
+++ b/lib/private/Files/Mount/ObjectHomeMountProvider.php
@@ -26,6 +26,7 @@ namespace OC\Files\Mount;
use OCP\Files\Config\IHomeMountProvider;
use OCP\Files\Storage\IStorageFactory;
use OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
/**
@@ -79,7 +80,7 @@ class ObjectHomeMountProvider implements IHomeMountProvider {
// sanity checks
if (empty($config['class'])) {
- \OCP\Util::writeLog('files', 'No class given for objectstore', \OCP\Util::ERROR);
+ \OCP\Util::writeLog('files', 'No class given for objectstore', ILogger::ERROR);
}
if (!isset($config['arguments'])) {
$config['arguments'] = [];
@@ -104,7 +105,7 @@ class ObjectHomeMountProvider implements IHomeMountProvider {
// sanity checks
if (empty($config['class'])) {
- \OCP\Util::writeLog('files', 'No class given for objectstore', \OCP\Util::ERROR);
+ \OCP\Util::writeLog('files', 'No class given for objectstore', ILogger::ERROR);
}
if (!isset($config['arguments'])) {
$config['arguments'] = [];
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index 2556180173a..9565a82ac31 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -27,6 +27,7 @@ namespace OC\Files\ObjectStore;
use Aws\ClientResolver;
use Aws\S3\Exception\S3Exception;
use Aws\S3\S3Client;
+use OCP\ILogger;
trait S3ConnectionTrait {
/** @var array */
@@ -113,7 +114,7 @@ trait S3ConnectionTrait {
} catch (S3Exception $e) {
$logger->logException($e, [
'message' => 'Invalid remote storage.',
- 'level' => \OCP\Util::DEBUG,
+ 'level' => ILogger::DEBUG,
'app' => 'objectstore',
]);
throw new \Exception('Creation of bucket "' . $this->bucket . '" failed. ' . $e->getMessage());
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index c9a91a7c56a..0d0f1da2594 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -54,6 +54,7 @@ use OCP\Files\InvalidPathException;
use OCP\Files\ReservedWordException;
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
+use OCP\ILogger;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
@@ -453,7 +454,7 @@ abstract class Common implements Storage, ILockingStorage {
return false;
} catch (\Exception $e) {
\OC::$server->getLogger()->info("External storage not available: " . $e->getMessage());
- \OC::$server->getLogger()->logException($e, ['level' => \OCP\Util::DEBUG]);
+ \OC::$server->getLogger()->logException($e, ['level' => ILogger::DEBUG]);
return false;
}
}
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index b3c2dc00189..1ce7b8acd45 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -35,6 +35,7 @@ namespace OC\Files\Storage;
use Exception;
use GuzzleHttp\Exception\RequestException;
+use OCP\ILogger;
use Psr\Http\Message\ResponseInterface;
use Icewind\Streams\CallbackWrapper;
use OC\Files\Filesystem;
@@ -357,7 +358,7 @@ class DAV extends Common {
if ($response->getStatusCode() === Http::STATUS_LOCKED) {
throw new \OCP\Lock\LockedException($path);
} else {
- Util::writeLog("webdav client", 'Guzzle get returned status code ' . $response->getStatusCode(), Util::ERROR);
+ Util::writeLog("webdav client", 'Guzzle get returned status code ' . $response->getStatusCode(), ILogger::ERROR);
}
}
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index a0e20f4cba1..46b53dcf95c 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -42,6 +42,7 @@ namespace OC\Files\Storage;
use OC\Files\Storage\Wrapper\Jail;
use OCP\Files\ForbiddenException;
use OCP\Files\Storage\IStorage;
+use OCP\ILogger;
/**
* for local filestore, we only have to map the paths
@@ -235,17 +236,17 @@ class Local extends \OC\Files\Storage\Common {
$dstParent = dirname($path2);
if (!$this->isUpdatable($srcParent)) {
- \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : ' . $srcParent, ILogger::ERROR);
return false;
}
if (!$this->isUpdatable($dstParent)) {
- \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : ' . $dstParent, ILogger::ERROR);
return false;
}
if (!$this->file_exists($path1)) {
- \OCP\Util::writeLog('core', 'unable to rename, file does not exists : ' . $path1, \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', 'unable to rename, file does not exists : ' . $path1, ILogger::ERROR);
return false;
}
@@ -382,7 +383,7 @@ class Local extends \OC\Files\Storage\Common {
return $fullPath;
}
- \OCP\Util::writeLog('core', "Following symlinks is not allowed ('$fullPath' -> '$realPath' not inside '{$this->realDataDir}')", \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', "Following symlinks is not allowed ('$fullPath' -> '$realPath' not inside '{$this->realDataDir}')", ILogger::ERROR);
throw new ForbiddenException('Following symlinks is not allowed', false);
}
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index 488218e8e74..109de4c4e5c 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -441,7 +441,7 @@ class Encryption extends Wrapper {
} catch (ModuleDoesNotExistsException $e) {
$this->logger->logException($e, [
'message' => 'Encryption module "' . $encryptionModuleId . '" not found, file will be stored unencrypted',
- 'level' => \OCP\Util::WARN,
+ 'level' => ILogger::WARN,
'app' => 'core',
]);
}
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index aaf14b4d7e0..a149cdf0af5 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -59,6 +59,7 @@ use OCP\Files\InvalidPathException;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\NotFoundException;
use OCP\Files\ReservedWordException;
+use OCP\ILogger;
use OCP\IUser;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
@@ -975,7 +976,7 @@ class View {
$hooks[] = 'write';
break;
default:
- \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, \OCP\Util::ERROR);
+ \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, ILogger::ERROR);
}
if ($mode !== 'r' && $mode !== 'w') {
@@ -1463,7 +1464,7 @@ class View {
// sometimes when the storage is not available it can be any exception
\OC::$server->getLogger()->logException($e, [
'message' => 'Exception while scanning storage "' . $subStorage->getId() . '"',
- 'level' => \OCP\Util::ERROR,
+ 'level' => ILogger::ERROR,
'app' => 'lib',
]);
continue;
@@ -1752,7 +1753,7 @@ class View {
if (!$targetStorage->instanceOfStorage('\OCP\Files\IHomeStorage')) {
\OCP\Util::writeLog('files',
'It is not allowed to move one mount point into another one',
- \OCP\Util::DEBUG);
+ ILogger::DEBUG);
return false;
}
@@ -1775,7 +1776,7 @@ class View {
if (count($shares) > 0) {
\OCP\Util::writeLog('files',
'It is not allowed to move one mount point into a shared folder',
- \OCP\Util::DEBUG);
+ ILogger::DEBUG);
return false;
}