update actor5 & actor6 data processing code
This commit is contained in:
1 parent
2095b48c56
commit
922a98e36b
29 files changed
+3694
-94
No files matched your search
+6
-4
@@ -29,20 +29,22 @@ class Logger(logging.Logger):
|
||||
def __init__(self, path_output, path_config=None, postfix=None, level=logging.NOTSET ):
|
||||
logging.Logger.__init__(self, '', level)
|
||||
|
||||
if postfix is None:
|
||||
postfix = f"{datetime.datetime.now().strftime('%Y%m%d-%HH%MM%SS')}"
|
||||
# logger filename suffix
|
||||
suffix = f"{datetime.datetime.now().strftime('%Y%m%d-%HH%MM%SS')}"
|
||||
if postfix is not None:
|
||||
suffix += str("-" + postfix)
|
||||
|
||||
# make dir & set filename
|
||||
if path_config is not None:
|
||||
basename = path_config.name.split(".")[0]
|
||||
self.path_output = Path(path_output).joinpath(basename, postfix)
|
||||
self.path_output = Path(path_output).joinpath(basename, suffix)
|
||||
self.path_output.mkdir(parents=True, exist_ok=True)
|
||||
filename = self.path_output.joinpath(f"logger.log")
|
||||
shutil.copyfile(src=path_config, dst=self.path_output.joinpath(path_config.name))
|
||||
else:
|
||||
self.path_output = Path(path_output)
|
||||
self.path_output.mkdir(parents=True, exist_ok=True)
|
||||
filename = self.path_output.joinpath(postfix + ".log")
|
||||
filename = self.path_output.joinpath(suffix + ".log")
|
||||
|
||||
# add file hander
|
||||
fHander = logging.FileHandler(filename)
|
||||
|
||||
Reference in new issue
Block a user