use \OCP\ILogger;
use OCP\Security\StringUtils;
+use OCP\Util;
/**
* logging utilities
/** @var string */
private $logger;
+
/** @var SystemConfig */
private $config;
/** @var boolean|null cache the result of the log condition check for the request */
private $logConditionSatisfied = null;
+
/** @var Normalizer */
private $normalizer;
}
-
/**
* System is unusable.
*
* @param string $message
* @param array $context
+ * @return void
*/
public function emergency($message, array $context = array()) {
- $this->log(\OCP\Util::FATAL, $message, $context);
+ $this->log(Util::FATAL, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function alert($message, array $context = array()) {
- $this->log(\OCP\Util::ERROR, $message, $context);
+ $this->log(Util::ERROR, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function critical($message, array $context = array()) {
- $this->log(\OCP\Util::ERROR, $message, $context);
+ $this->log(Util::ERROR, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function error($message, array $context = array()) {
- $this->log(\OCP\Util::ERROR, $message, $context);
+ $this->log(Util::ERROR, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function warning($message, array $context = array()) {
- $this->log(\OCP\Util::WARN, $message, $context);
+ $this->log(Util::WARN, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function notice($message, array $context = array()) {
- $this->log(\OCP\Util::INFO, $message, $context);
+ $this->log(Util::INFO, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function info($message, array $context = array()) {
- $this->log(\OCP\Util::INFO, $message, $context);
+ $this->log(Util::INFO, $message, $context);
}
/**
*
* @param string $message
* @param array $context
+ * @return void
*/
public function debug($message, array $context = array()) {
- $this->log(\OCP\Util::DEBUG, $message, $context);
+ $this->log(Util::DEBUG, $message, $context);
}
* @param mixed $level
* @param string $message
* @param array $context
+ * @return void
*/
public function log($level, $message, array $context = array()) {
- $minLevel = min($this->config->getValue('loglevel', \OCP\Util::WARN), \OCP\Util::ERROR);
+ $minLevel = min($this->config->getValue('loglevel', Util::WARN), Util::ERROR);
$logCondition = $this->config->getValue('log.condition', []);
array_walk($context, [$this->normalizer, 'format']);
if(!empty($logCondition)
&& isset($logCondition['apps'])
&& in_array($app, $logCondition['apps'], true)) {
- $minLevel = \OCP\Util::DEBUG;
+ $minLevel = Util::DEBUG;
}
} else {
// if log condition is satisfied change the required log level to DEBUG
if($this->logConditionSatisfied) {
- $minLevel = \OCP\Util::DEBUG;
+ $minLevel = Util::DEBUG;
}
if ($level >= $minLevel) {