Kill static logger
This commit is contained in:
parent
98db623f07
commit
5c8a7923cb
@ -37,7 +37,11 @@ class Config {
|
||||
$exists = file_exists($outfile);
|
||||
|
||||
if (!$exists){
|
||||
Helper::warnLog('Conversion test failed. Raw output:' . $result);
|
||||
\OC::$server->getLogger()->warn(
|
||||
'Conversion test failed. Raw output:' . $result,
|
||||
['app' => 'documents']
|
||||
|
||||
);
|
||||
return false;
|
||||
} else {
|
||||
unlink($outfile);
|
||||
|
@ -22,7 +22,11 @@ class Converter {
|
||||
}
|
||||
|
||||
if (empty($output)){
|
||||
Helper::warnLog('Empty conversion output');
|
||||
\OC::$server->getLogger()->warn(
|
||||
'Empty conversion output',
|
||||
['app' => 'documents']
|
||||
|
||||
);
|
||||
throw new \RuntimeException('Empty conversion output');
|
||||
}
|
||||
return $output;
|
||||
@ -86,7 +90,11 @@ class Converter {
|
||||
curl_setopt_array($ch, $options);
|
||||
$content = curl_exec($ch);
|
||||
if (curl_errno($ch)){
|
||||
Helper::debugLog('cURL error' . curl_errno($ch) . ':' . curl_error($ch));
|
||||
\OC::$server->getLogger()->debug(
|
||||
'cURL error' . curl_errno($ch) . ':' . curl_error($ch),
|
||||
['app' => 'documents']
|
||||
|
||||
);
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
|
@ -54,24 +54,6 @@ class Helper {
|
||||
return '#' . self::convertHSLToRGB($hue, 90, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public static function debugLog($message){
|
||||
self::log($message, \OCP\Util::DEBUG);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public static function warnLog($message){
|
||||
self::log($message, \OCP\Util::WARN);
|
||||
}
|
||||
|
||||
public static function log($message, $level){
|
||||
\OCP\Util::writeLog(self::APP_ID, $message, $level);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $iH
|
||||
* @param integer $iS
|
||||
@ -178,8 +160,16 @@ class Helper {
|
||||
}
|
||||
|
||||
if (empty($cmd)){
|
||||
Helper::warnLog('Pure configuration issue. Missing open office binary that is mandatory for conversion.');
|
||||
Helper::debugLog('If openoffice or libreoffice is already installed please specify the path to it using preview_libreoffice_path config. Refer to admin manual for details.');
|
||||
\OC::$server->getLogger()->warn(
|
||||
'Pure configuration issue. Missing open office binary that is mandatory for conversion.',
|
||||
['app' => 'documents']
|
||||
|
||||
);
|
||||
\OC::$server->getLogger()->debug(
|
||||
'If openoffice or libreoffice is already installed please specify the path to it using preview_libreoffice_path config. Refer to admin manual for details.',
|
||||
['app' => 'documents']
|
||||
|
||||
);
|
||||
throw new \RuntimeException('Missing open office binary that is mandatory for conversion.');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user