diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/iconfig.php | 15 | ||||
-rw-r--r-- | lib/public/ilogger.php | 10 | ||||
-rw-r--r-- | lib/public/iservercontainer.php | 6 | ||||
-rw-r--r-- | lib/public/util.php | 11 |
4 files changed, 33 insertions, 9 deletions
diff --git a/lib/public/iconfig.php b/lib/public/iconfig.php index ff0b6c6a5b0..933eef97ae1 100644 --- a/lib/public/iconfig.php +++ b/lib/public/iconfig.php @@ -41,6 +41,11 @@ namespace OCP; */ interface IConfig { /** + * @since 8.2.0 + */ + const SENSITIVE_VALUE = '***REMOVED SENSITIVE VALUE***'; + + /** * Sets and deletes system wide values * * @param array $configs Associative array with `key => value` pairs @@ -69,6 +74,16 @@ interface IConfig { public function getSystemValue($key, $default = ''); /** + * Looks up a system wide defined value and filters out sensitive data + * + * @param string $key the key of the value, under which it was saved + * @param mixed $default the default value to be returned if the value isn't set + * @return mixed the value or $default + * @since 8.2.0 + */ + public function getFilteredSystemValue($key, $default = ''); + + /** * Delete a system wide defined value * * @param string $key the key of the value, under which it was saved diff --git a/lib/public/ilogger.php b/lib/public/ilogger.php index 43b1ef70e5b..27a5d63dfdb 100644 --- a/lib/public/ilogger.php +++ b/lib/public/ilogger.php @@ -122,4 +122,14 @@ interface ILogger { * @since 7.0.0 */ public function log($level, $message, array $context = array()); + + /** + * Logs an exception very detailed + * + * @param \Exception $exception + * @param array $context + * @return void + * @since 8.2.0 + */ + public function logException(\Exception $exception, array $context = array()); } diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index 8be23dff214..e37652c1adc 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -194,6 +194,12 @@ interface IServerContainer { public function getAppConfig(); /** + * @return \OCP\L10N\IFactory + * @since 8.2.0 + */ + public function getL10NFactory(); + + /** * get an L10N instance * @param string $app appid * @param string $lang diff --git a/lib/public/util.php b/lib/public/util.php index c32668b14a8..652df5192cf 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -158,17 +158,10 @@ class Util { * @param \Exception $ex exception to log * @param int $level log level, defaults to \OCP\Util::FATAL * @since ....0.0 - parameter $level was added in 7.0.0 + * @deprecated 8.2.0 use logException of \OCP\ILogger */ public static function logException( $app, \Exception $ex, $level = \OCP\Util::FATAL ) { - $exception = array( - 'Exception' => get_class($ex), - 'Message' => $ex->getMessage(), - 'Code' => $ex->getCode(), - 'Trace' => $ex->getTraceAsString(), - 'File' => $ex->getFile(), - 'Line' => $ex->getLine(), - ); - \OCP\Util::writeLog($app, 'Exception: ' . json_encode($exception), $level); + \OC::$server->getLogger()->logException($ex, ['app' => $app]); } /** |