Skip to content
Snippets Groups Projects
Commit 10cd8ff5 authored by philip.roeggla's avatar philip.roeggla
Browse files

log to output folder

parent 790627c3
No related branches found
No related tags found
No related merge requests found
......@@ -33,9 +33,16 @@ async def extract(input_file: str, output_folder: str) -> typing.NoReturn:
converter.write()
match = regex.search(r'[dD]1\d', input_file)
name = match.group(0) if match else 'VDXX'
converter.log.to_csv('log-' + name + datetime.datetime.now().strftime("-%Y-%m-%d-%H:%M:%S") + '.csv')
output_log = output_path.joinpath('log')
output_log.mkdir(parents=True, exist_ok=True)
converter.log.to_csv(output_log.joinpath(
'log-' + name + datetime.datetime.now().strftime("-%Y-%m-%d-%H:%M:%S") + '.csv'
))
# to do unblock
with open('sub-log-' + name + datetime.datetime.now().strftime("-%Y-%m-%d-%H:%M:%S") + '.json', 'w') as file:
with open(
output_log.joinpath(
'sub-log-' + name + datetime.datetime.now().strftime("-%Y-%m-%d-%H:%M:%S") + '.json', 'w')
) as file:
json.dump(converter.sub_log, file)
loop = asyncio.new_event_loop()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment