diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-09-18 20:56:07 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-09-18 21:47:25 +0300 |
commit | 5c8a7923cbff95c023b3731f8236f2f5b69bd7c5 (patch) | |
tree | ef702662287152cf44f42dd68aba13f0d698c193 /lib | |
parent | 98db623f0717bb2cefc6d874aa1a4dc168b529dc (diff) |
Kill static logger
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config.php | 6 | ||||
-rw-r--r-- | lib/converter.php | 12 | ||||
-rw-r--r-- | lib/helper.php | 30 |
3 files changed, 25 insertions, 23 deletions
diff --git a/lib/config.php b/lib/config.php index 3d5848bf..6065de87 100644 --- a/lib/config.php +++ b/lib/config.php @@ -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); diff --git a/lib/converter.php b/lib/converter.php index 5dbe2007..ccd3d6b3 100644 --- a/lib/converter.php +++ b/lib/converter.php @@ -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); diff --git a/lib/helper.php b/lib/helper.php index e6ffaee5..2f02be51 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -55,24 +55,6 @@ class Helper { } /** - * @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 * @param integer $iV @@ -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.'); } |