feat: using date as key in log and error log #457

This commit is contained in:
vnmedeiros 2021-03-23 11:50:16 -03:00
parent 97fdfa4a73
commit e51f37d476
3 changed files with 14 additions and 8 deletions

View File

@ -355,11 +355,13 @@ abstract class Exporter {
}
public function add_log($message ) {
$this->log[] = '[' . date("Y-m-d H:i:s") . '] ' . $message;
$date_key = '[' . date("Y-m-d H:i:s") . '] ';
$this->log[$date_key] = $message;
}
public function add_error_log($message ) {
$this->error_log[] = '[' . date("Y-m-d H:i:s") . '] ' . $message;
$date_key = '[' . date("Y-m-d H:i:s") . '] ';
$this->error_log[$date_key] = $message;
}
public function is_finished() {

View File

@ -146,11 +146,13 @@ abstract class Generic_Process {
}
public function add_log($message ) {
$this->log[] = $message;
$date_key = '[' . date("Y-m-d H:i:s") . '] ';
$this->log[$date_key] = $message;
}
public function add_error_log($message ) {
$this->error_log[] = $message;
public function add_error_log($message ){
$date_key = '[' . date("Y-m-d H:i:s") . '] ';
$this->error_log[$date_key] = $message;
}
public function is_finished() {

View File

@ -344,11 +344,13 @@ abstract class Importer {
* @param $type
* @param $messagelog
*/
public function add_log($message ){
$this->log[] = '[' . date("Y-m-d H:i:s") . '] ' . $message;
public function add_log($message ) {
$date_key = '[' . date("Y-m-d H:i:s") . '] ';
$this->log[$date_key] = $message;
}
public function add_error_log($message ){
$this->error_log[] = '[' . date("Y-m-d H:i:s") . '] ' . $message;
$date_key = '[' . date("Y-m-d H:i:s") . '] ';
$this->error_log[$date_key] = $message;
}
public function add_collection(array $collection) {