Update ddrescue-tui logging handling

This commit is contained in:
2Shirt 2023-07-09 00:16:46 -07:00
parent 4467369811
commit 090a9f2b96
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -1758,7 +1758,18 @@ def source_or_destination_changed(state) -> bool:
def main() -> None:
"""Main function for ddrescue TUI."""
args = docopt(DOCSTRING)
log.update_log_path(dest_name='ddrescue-TUI', timestamp=True)
log_dir = log.format_log_path()
log_dir = pathlib.Path(
f'{log_dir.parent}/'
f'ddrescue-TUI_{time.strftime("%Y-%m-%d_%H%M%S%z")}/'
)
log.update_log_path(
dest_dir=log_dir,
dest_name='main',
keep_history=False,
timestamp=False,
)
LOG.info('ddrescue-tui Start')
# Check if running inside tmux
if 'TMUX' not in os.environ: