diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-04-25 15:22:28 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-04-26 10:45:52 +0200 |
commit | 38a90130ce425d531a804dff591df4a883de3154 (patch) | |
tree | d579e7442832672ab2987f9c9ecf62e79ca09a8d /lib/private/legacy | |
parent | 12c5db90322f61d4d48e1bb534bb94382d17e317 (diff) | |
download | nextcloud-server-38a90130ce425d531a804dff591df4a883de3154.tar.gz nextcloud-server-38a90130ce425d531a804dff591df4a883de3154.zip |
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/app.php | 13 | ||||
-rw-r--r-- | lib/private/legacy/db.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/files.php | 3 | ||||
-rw-r--r-- | lib/private/legacy/user.php | 10 | ||||
-rw-r--r-- | lib/private/legacy/util.php | 9 |
5 files changed, 23 insertions, 16 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 88d5ce1f135..7931eecc502 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -56,6 +56,7 @@ use OC\DB\MigrationService; use OC\Installer; use OC\Repair; use OCP\App\ManagerEvent; +use OCP\ILogger; /** * This class manages the apps. It allows them to register and integrate in the @@ -425,7 +426,7 @@ class OC_App { } } - \OCP\Util::writeLog('core', 'No application directories are marked as writable.', \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'No application directories are marked as writable.', ILogger::ERROR); return null; } @@ -666,7 +667,7 @@ class OC_App { foreach (OC::$APPSROOTS as $apps_dir) { if (!is_readable($apps_dir['path'])) { - \OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], \OCP\Util::WARN); + \OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], ILogger::WARN); continue; } $dh = opendir($apps_dir['path']); @@ -707,12 +708,12 @@ class OC_App { $info = OC_App::getAppInfo($app, false, $langCode); if (!is_array($info)) { - \OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', ILogger::ERROR); continue; } if (!isset($info['name'])) { - \OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', ILogger::ERROR); continue; } @@ -994,11 +995,11 @@ class OC_App { } return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId); } else { - \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', ILogger::ERROR); return false; } } else { - \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', ILogger::ERROR); return false; } } diff --git a/lib/private/legacy/db.php b/lib/private/legacy/db.php index 7c556baeaeb..7e18cbe1875 100644 --- a/lib/private/legacy/db.php +++ b/lib/private/legacy/db.php @@ -28,6 +28,8 @@ * */ +use OCP\ILogger; + /** * This class manages the access to the database. It basically is a wrapper for * Doctrine with some adaptions. @@ -185,7 +187,7 @@ class OC_DB { try { $result = $schemaManager->updateDbFromStructure($file); } catch (Exception $e) { - \OCP\Util::writeLog('core', 'Failed to update database structure ('.$e.')', \OCP\Util::FATAL); + \OCP\Util::writeLog('core', 'Failed to update database structure ('.$e.')', ILogger::FATAL); throw $e; } return $result; diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php index 9281c1f7da4..00cd5fbfe51 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -41,6 +41,7 @@ use OC\Files\View; use OC\Streamer; +use OCP\ILogger; use OCP\Lock\ILockingProvider; /** @@ -422,7 +423,7 @@ class OC_Files { if (!$handle) { \OCP\Util::writeLog('files', 'Can\'t write upload limit to ' . $filename . '. Please check the file permissions', - \OCP\Util::WARN); + ILogger::WARN); $success = false; continue; // try to update as many files as possible } diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php index 9c877f22a46..ebb1ff2215b 100644 --- a/lib/private/legacy/user.php +++ b/lib/private/legacy/user.php @@ -38,6 +38,8 @@ * */ +use OCP\ILogger; + /** * This class provides wrapper methods for user management. Multiple backends are * supported. User management operations are delegated to the configured backend for @@ -89,7 +91,7 @@ class OC_User { case 'database': case 'mysql': case 'sqlite': - \OCP\Util::writeLog('core', 'Adding user backend ' . $backend . '.', \OCP\Util::DEBUG); + \OCP\Util::writeLog('core', 'Adding user backend ' . $backend . '.', ILogger::DEBUG); self::$_usedBackends[$backend] = new \OC\User\Database(); \OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]); break; @@ -98,7 +100,7 @@ class OC_User { \OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]); break; default: - \OCP\Util::writeLog('core', 'Adding default user backend ' . $backend . '.', \OCP\Util::DEBUG); + \OCP\Util::writeLog('core', 'Adding default user backend ' . $backend . '.', ILogger::DEBUG); $className = 'OC_USER_' . strtoupper($backend); self::$_usedBackends[$backend] = new $className(); \OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]); @@ -143,10 +145,10 @@ class OC_User { self::useBackend($backend); self::$_setupedBackends[] = $i; } else { - \OCP\Util::writeLog('core', 'User backend ' . $class . ' already initialized.', \OCP\Util::DEBUG); + \OCP\Util::writeLog('core', 'User backend ' . $class . ' already initialized.', ILogger::DEBUG); } } else { - \OCP\Util::writeLog('core', 'User backend ' . $class . ' not found.', \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'User backend ' . $class . ' not found.', ILogger::ERROR); } } } diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 3313ccdec91..d3599d14e7a 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -62,6 +62,7 @@ use OCP\IConfig; use OCP\IGroupManager; +use OCP\ILogger; use OCP\IUser; class OC_Util { @@ -100,7 +101,7 @@ class OC_Util { private static function initObjectStoreRootFS($config) { // check misconfiguration 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'] = array(); @@ -134,7 +135,7 @@ class OC_Util { private static function initObjectStoreMultibucketRootFS($config) { // check misconfiguration 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'] = array(); @@ -409,7 +410,7 @@ class OC_Util { \OCP\Util::writeLog( 'files_skeleton', 'copying skeleton for '.$userId.' from '.$skeletonDirectory.' to '.$userDirectory->getFullPath('/'), - \OCP\Util::DEBUG + ILogger::DEBUG ); self::copyr($skeletonDirectory, $userDirectory); // update the file cache @@ -1378,7 +1379,7 @@ class OC_Util { // XCache if (function_exists('xcache_clear_cache')) { if (\OC::$server->getIniWrapper()->getBool('xcache.admin.enable_auth')) { - \OCP\Util::writeLog('core', 'XCache opcode cache will not be cleared because "xcache.admin.enable_auth" is enabled.', \OCP\Util::WARN); + \OCP\Util::writeLog('core', 'XCache opcode cache will not be cleared because "xcache.admin.enable_auth" is enabled.', ILogger::WARN); } else { @xcache_clear_cache(XC_TYPE_PHP, 0); } |