Update Debug\Logger for some simpler code

All strings are written to an array and not string append.
Group debug write/debug echo better to make it more simple.
Fixed bug with echo output in logging

Also set debug to be deprecated for phan testing
This commit is contained in:
Clemens Schwaighofer
2021-06-16 10:11:44 +09:00
parent b628331a9b
commit d068aaeed7
5 changed files with 74 additions and 49 deletions

View File

@@ -407,7 +407,7 @@ class ArrayIO extends \CoreLibs\DB\IO
}
// integer is different
if (isset($this->table_array[$column]['int']) || isset($this->table_array[$column]['int_null'])) {
$this->debug('write_check', '['.$column.']['.$this->table_array[$column]['value'].']['.$this->table_array[$column]['type'].'] '.
$this->log->debug('write_check', '['.$column.']['.$this->table_array[$column]['value'].']['.$this->table_array[$column]['type'].'] '.
'VALUE SET: '.(string)isset($this->table_array[$column]['value']).
' | INT NULL: '.(string)isset($this->table_array[$column]['int_null']));
if (isset($this->table_array[$column]['value']) &&

View File

@@ -547,7 +547,7 @@ class IO extends \CoreLibs\Basic
if ($prefix) {
$prefix .= '- ';
}
$this->debug($debug_id, $prefix.$error_string, true);
$this->log->debug($debug_id, $prefix.$error_string, true);
}
/**
@@ -1624,7 +1624,7 @@ class IO extends \CoreLibs\Basic
}
$result = $this->db_functions->__dbExecute($stm_name, $data);
if (!$result) {
$this->debug('ExecuteData', 'ERROR in STM['.$stm_name.'|'.$this->prepare_cursor[$stm_name]['result'].']: '.\CoreLibs\Debug\Support::printAr($data));
$this->log->debug('ExecuteData', 'ERROR in STM['.$stm_name.'|'.$this->prepare_cursor[$stm_name]['result'].']: '.\CoreLibs\Debug\Support::printAr($data));
$this->error_id = 22;
$this->__dbError($this->prepare_cursor[$stm_name]['result']);
$this->__dbDebug('db', '<span style="color: red;"><b>DB-Error</b> '.$stm_name.': Execution failed</span>', 'DB_ERROR');