jvde-github/AIS-catcher

Append to existing log file

JS-HobbySoft opened this issue · 6 comments

I'd like to request that the default behavior of the '-f' command line switch is to append to an existing log file if it exists. I think the only change that needs to be made is in line 107 of IO.h from

file.open(filename, std::ios::out);

to

file.open(filename, std::ios::app);

I've been tinkering with the command line options, and I accidentally deleted some logs while quickly changing options and forgetting to change the name of the log file. This change might prevent someone else from accidentally deleting their data in the future.

I don't think the feature is used that much yet so I think it is fine to change the default behaviour.

You can use -f filename but also use -f filename MODE APPEND or -f filename MODE APP.
The original method is now -f filename MODE OUT

Does this help?

Does not compile on Windows for some reason (Linux fine), will fix .....

Thanks for the quick response, that definitely helps! I didn't know I could add the append option to the command line, I'll use that until the code is updated. Thanks!

Accidentally hit close instead of comment

It is fixed on windows now as well

Thanks for the quick response, that definitely helps! I didn't know I could add the append option to the command line, I'll use that until the code is updated. Thanks!

Just to be clear: I just added this in the latest update together with changing the default to append