Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log file which self-truncates after a certain size #14

Open
daboross opened this issue Sep 4, 2017 · 2 comments
Open

Log file which self-truncates after a certain size #14

daboross opened this issue Sep 4, 2017 · 2 comments

Comments

@daboross
Copy link
Owner

daboross commented Sep 4, 2017

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.

@iddm
Copy link

iddm commented Mar 15, 2018

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.

@daboross
Copy link
Owner Author

daboross commented Mar 15, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants