Define somewhere a maximum size for the log file.
Before each new instance of the logger, it will check if the file is not bigger than the size, if yes, delete it.
To not force delete the file, the old file is moved with a timestamp :
out.log > out_<epoch>.log
The user should delete this file if he wants.