tbird20d / grabserial

Grabserial - python-based serial dump and timing program - good for embedded Linux development
GNU General Public License v2.0
195 stars 77 forks source link

Feature rollover output filename with date pattern #34

Closed AlphaSierraHotel closed 4 years ago

AlphaSierraHotel commented 4 years ago

This added logic will determine if a date substitution parameter is used in the output file name. If it is, and the system date changes, the output file will be closed and a new one opened.

This allows for continuous logging to an output file with a roll-over effect each day - effectively a log file for each day of logging data.

A suggested file name pattern might be: -%Y-%m-%d Example: -o "pooltemp-%Y-%m-%d" -A

AlphaSierraHotel commented 4 years ago

Is there anything you want me to change with regards to this pull request?

tbird20d commented 4 years ago

I've applied the feature, but as a single patch. I'd prefer to avoid having the patch development history in the git history, so I squashed the commits.

If you wouldn't mind, please add something to the README.md about this behavior. This is now the default behavior whenever an output filename is used and it has a date in it. It is possible for someone who is doing regular logging close to midnight to get confused by the switchover, so I'd like it documented somewhere.

Thanks for the feature! -- Tim