Closed cristian5th closed 8 months ago
Second commit is to save gcexport.log file into the export directory so all files are located at the same place
Oh, I misread the PR (edited previous comment)!
In any case, if we wanted to take this approach, it would be nice to handle multiple files in the archive as well (see #63).
Second commit is to save gcexport.log file into the export directory so all files are located at the same place
Nice improvement. In case this PR would be rejected, I would still vote for cherry-picking this commit.
I'm not sure this is an improvement. If I run the script several times in a row I'd get several log files; I prefer to have only one log file to easily find the logs of all different script executions. But maybe this could be made configurable?
How can this be if the filename and folder is the same every execution? What are the names of the different log files that you get with every execution?
How can this be if the filename and folder is the same every execution? What are the names of the different log files that you get with every execution?
That really depends on your workflow. The default export directory is ./YYYY-MM-DD_garmin_connect_export
, i.e. changing every day. And for my tests I often build the the export directory with the suffix `date +%Y-%m-%d_%H-%M-%S`
, i.e. a separate directory for every run. So if the logfile is written to the export directory, I get a separate logfile for every execution.
But I agree that for some workflows it might be desirable to have the logfile in the export directory, so I think we should find a suitable command line option. Maybe a flag would be enough to decide between the script and the export directory? Or should we have more options to also allow an OS-dependent place (something like /var/log/...
?), but that would need some research on what are the expected places per OS...
I can open a new PR so that a new argument --logfile
indicates the requested location by the user. The default location would be derived from the --directory
. This way you can always add --logfile=.
to achieve the current behaviour.
Note: this is a breaking change but I think it's okay.
Are you OK with this solution?
I can open a new PR so that a new argument
--logfile
indicates the requested location by the user. The default location would be derived from the--directory
. This way you can always add--logfile=.
to achieve the current behaviour. Note: this is a breaking change but I think it's okay.Are you OK with this solution?
Yes, thanks!
It is risky to create the original filename based on the contents of the zip file. Actually, Garmin has recently changed this filename.
The proposal is to make a totally new filename based on the activity ID, independently of how Garmin has decided to name the downloaded file.
Solves issue #63