diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-20 14:35:37 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-22 20:41:49 +0200 |
commit | dd34cb75404fb806da7e780bc5804fc958a75456 (patch) | |
tree | 9a8298a0e72f004ed3ff90984f2f19c509b4c007 /apps/files_versions | |
parent | 8748e636f69c290926a297a24d21b248ad58de53 (diff) | |
download | nextcloud-server-dd34cb75404fb806da7e780bc5804fc958a75456.tar.gz nextcloud-server-dd34cb75404fb806da7e780bc5804fc958a75456.zip |
Less deprecated calls to OCP\Util::writeLog
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/Storage.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index f8a6636839a..52afdfdaa5a 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -658,7 +658,7 @@ class Storage { //distance between two version too small, mark to delete $toDelete[$key] = $version['path'] . '.v' . $version['version']; $size += $version['size']; - \OCP\Util::writeLog('files_versions', 'Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . " or smaller. (prevTimestamp: " . $prevTimestamp . "; step: " . $step, \OCP\Util::INFO); + \OC::$server->getLogger()->info('Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . " or smaller. (prevTimestamp: " . $prevTimestamp . "; step: " . $step, ['app' => 'files_versions']); } else { $nextVersion = $version['version'] - $step; $prevTimestamp = $version['version']; @@ -713,7 +713,7 @@ class Storage { // get available disk space for user $user = \OC::$server->getUserManager()->get($uid); if (is_null($user)) { - \OCP\Util::writeLog('files_versions', 'Backends provided no user object for ' . $uid, \OCP\Util::ERROR); + \OC::$server->getLogger()->error('Backends provided no user object for ' . $uid, ['app' => 'files_versions']); throw new \OC\User\NoUserException('Backends provided no user object for ' . $uid); } @@ -782,12 +782,13 @@ class Storage { $versionsSize = $versionsSize - $sizeOfDeletedVersions; } + $logger = \OC::$server->getLogger(); foreach($toDelete as $key => $path) { \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED)); self::deleteVersion($versionsFileview, $path); \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED)); unset($allVersions[$key]); // update array with the versions we keep - \OCP\Util::writeLog('files_versions', "Expire: " . $path, \OCP\Util::INFO); + $logger->info('Expire: ' . $path, ['app' => 'files_versions']); } // Check if enough space is available after versions are rearranged. @@ -803,7 +804,7 @@ class Storage { \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED)); self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']); \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED)); - \OCP\Util::writeLog('files_versions', 'running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'] , \OCP\Util::INFO); + \OC::$server->getLogger()->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']); $versionsSize -= $version['size']; $availableSpace += $version['size']; next($allVersions); |