Kill static logger
This commit is contained in:
parent
98db623f07
commit
5c8a7923cb
@ -37,7 +37,11 @@ class Config {
|
|||||||
$exists = file_exists($outfile);
|
$exists = file_exists($outfile);
|
||||||
|
|
||||||
if (!$exists){
|
if (!$exists){
|
||||||
Helper::warnLog('Conversion test failed. Raw output:' . $result);
|
\OC::$server->getLogger()->warn(
|
||||||
|
'Conversion test failed. Raw output:' . $result,
|
||||||
|
['app' => 'documents']
|
||||||
|
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
unlink($outfile);
|
unlink($outfile);
|
||||||
|
@ -22,7 +22,11 @@ class Converter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($output)){
|
if (empty($output)){
|
||||||
Helper::warnLog('Empty conversion output');
|
\OC::$server->getLogger()->warn(
|
||||||
|
'Empty conversion output',
|
||||||
|
['app' => 'documents']
|
||||||
|
|
||||||
|
);
|
||||||
throw new \RuntimeException('Empty conversion output');
|
throw new \RuntimeException('Empty conversion output');
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
@ -86,7 +90,11 @@ class Converter {
|
|||||||
curl_setopt_array($ch, $options);
|
curl_setopt_array($ch, $options);
|
||||||
$content = curl_exec($ch);
|
$content = curl_exec($ch);
|
||||||
if (curl_errno($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);
|
curl_close($ch);
|
||||||
|
|
||||||
|
@ -54,24 +54,6 @@ class Helper {
|
|||||||
return '#' . self::convertHSLToRGB($hue, 90, 60);
|
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 $iH
|
||||||
* @param integer $iS
|
* @param integer $iS
|
||||||
@ -178,8 +160,16 @@ class Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($cmd)){
|
if (empty($cmd)){
|
||||||
Helper::warnLog('Pure configuration issue. Missing open office binary that is mandatory for conversion.');
|
\OC::$server->getLogger()->warn(
|
||||||
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.');
|
'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.');
|
throw new \RuntimeException('Missing open office binary that is mandatory for conversion.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user