use new log class

Dieser Commit ist enthalten in:
o.pinke 2024-03-12 19:19:19 +01:00
Ursprung 24ba3bdb26
Commit 754c174e9d
2 geänderte Dateien mit 21 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,10 @@
*
* $Id$
*/
use ConLite\Log\LogWriter;
use ConLite\Log\Log;
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -148,9 +152,9 @@ class cApiModule extends Item {
try {
mkdir($this->_aModFileEditConf['modPath'], 0777, true);
} catch (Exception $ex) {
$oWriter = cLogWriter::factory("File", ['destination' => $sPathErrorLog]);
$oLog = new cLog($oWriter);
$oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN);
$writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]);
$log = new Log($writer);
$log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), Log::WARN);
}
}
@ -160,9 +164,9 @@ class cApiModule extends Item {
try {
mkdir($this->getModulePath(), 0777);
} catch (Exception $ex) {
$oWriter = cLogWriter::factory("File", ['destination' => $sPathErrorLog]);
$oLog = new cLog($oWriter);
$oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN);
$writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]);
$log = new Log($writer);
$log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), Log::WARN);
}
if (is_writable($this->getModulePath())) {
@ -171,9 +175,9 @@ class cApiModule extends Item {
umask($this->_oldumask);
}
} else {
$oWriter = cLogWriter::factory("File", ['destination' => $sPathErrorLog]);
$oLog = new cLog($oWriter);
$oLog->log(__FILE__ . " (" . __LINE__ . "): " . 'Error: Cannot create mod path '.$this->getModulePath(), cLog::WARN);
$writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]);
$log = new Log($writer);
$log->log(__FILE__ . " (" . __LINE__ . "): " . 'Error: Cannot create mod path '.$this->getModulePath(), Log::WARN);
}
return FALSE;
}
@ -244,7 +248,8 @@ class cApiModule extends Item {
*
* @return array Found strings for this module
*/
public function parseModuleForStrings() {
public function parseModuleForStrings(): bool|array
{
global $cfg;
if ($this->virgin == true) {
return false;

Datei anzeigen

@ -1,4 +1,8 @@
<?php
use ConLite\Log\LogWriter;
use ConLite\Log\Log;
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -12,11 +16,11 @@ class pimExeption extends Exception {
parent::__construct($message, $code, $previous);
// create a logger class and save it for all logging purposes
$writer = cLogWriter::factory("File", array(
$writer = LogWriter::factory("File", array(
'destination' => cRegistry::getConfigValue('path', 'data')
. 'logs/exception.log'
));
$this->_logger = new cLog($writer);
$this->_logger = new Log($writer);
// determine if exception should be logged
if (false === $this->_log_exception