Skip to content
Snippets Groups Projects
Commit 6b03fc6c authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT
Browse files

Merge branch 'dev#176789_gers' into 'master'

dev#176789 : task#179397 : log to temp file

See merge request !4770
parents 28629dd1 e3e56fb4
Branches
Tags
1 merge request!4770dev#176789 : task#179397 : log to temp file
Pipeline #24161 passed with stage
in 22 minutes and 32 seconds
<?php
require(__DIR__.'/../console.php');
require_once(__DIR__.'/../cosmogramme/php/_init.php');
require_once(__DIR__.'/../cosmogramme/php/classes/classe_log.php');
$filename = $argv[1];
$subfield = $argv[2];
......@@ -16,11 +13,23 @@ It stores records with related items depending on the subfield parameter.
Usage : php split_unimarc_by_site.php <file_to_split_path> <subfield_tag_to_split_file_on> <destination_directory>
EOF;
$log = new log('integration');
$log_debug = new log('debug', false);
$log->setDebugLog($log_debug);
$log->open(true);
$log_debug->open(true);
class Write_Log_In_Temp {
protected $_path = './temp/split_unimarc_by_site.log';
public function __construct() {
file_put_contents($this->_path,
'');
}
public function log($message) {
file_put_contents($this->_path,
$message . "\n",
FILE_APPEND);
}
}
$log = new Write_Log_In_Temp;
(new Class_Cosmogramme_Integration_SplitBySite)
->setLogger($log)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment