fern
fern copied to clipboard
Log file which self-truncates after a certain size
I think it would be sane to add an option for a simple log file which removes old records once it reaches 16 megabytes, or a similar size. This would be useful for sane command line applications which might want to output much more debug logging, and now wouldn't have to worry about cleaning it up.
This would need to be implemented efficiently though, so more knowledge on ways to do this in Linux and Windows is needed.
What about simply checking the file size in some period of time? Not everytime we call the debug!
and other macroses, but, for example, each 100 calls. This can be configurable, of course.
That would definitely be possible!
I haven't done anything on this front yet because I'm not sure what the best practices would be for checking the starting number of lines (or bytes), and I'm not sure of the best way to truncate log files on each platform. I'm thinking a limit in terms of kilobytes would be easier than one in terms of lines, though both are possible.