fern icon indicating copy to clipboard operation
fern copied to clipboard

Log file which self-truncates after a certain size

Open daboross opened this issue 6 years ago • 2 comments

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.

daboross avatar Sep 04 '17 07:09 daboross

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.

iddm avatar Mar 15 '18 17:03 iddm

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.

daboross avatar Mar 15 '18 22:03 daboross