Improve log system

This commit is contained in:
Noe Brucy
2022-08-26 20:06:38 +02:00
parent 07017611ee
commit 67f8f014d6
4 changed files with 74 additions and 39 deletions
+8 -6
View File
@@ -38,13 +38,18 @@ class StudyProcessor(Aggregator, HDF5Container):
Creates the basic structures needed for the outputs
"""
# log id
self.log_id = "study {}".format(tag)
super(StudyProcessor, self).__init__(path, path_out, params, tag)
# Open outfile
tag_name = self.params.out.tag
if not self.params.out.tag == "":
tag_name = "_" + self.params.out.tag
else:
tag_name = ""
tag_name = "_" + tag_name
if self.params.out.ext_subfolder:
self.filename = f"{self.path_out}/h5/study{tag_name}.h5"
@@ -100,9 +105,6 @@ class StudyProcessor(Aggregator, HDF5Container):
dest = f"{self.path_out}/{run}/logs/{os.path.basename(log)}"
copy_file(log, dest, update=1)
# log info
self.log_id = "[study {}] ".format(self.params.out.tag)
# Define rules
self.def_rules()