FileSeries is a Ruby library for writing to a group of files.
Writes will be directed to new files at a configurable frequency.
=> logger = FileSeries.new('.', :prefix=>'test', :rotate_every=>60) => logger.write("some message\n")
This will create a file like 'test-1342477810-60.log'. A new file will be created every 60 seconds. You don't need to do anything except keep calling logger.write().
Files are created as needed, so you won't end up with lots of 0-length files. If you do see a recent 0-length file, it's probably due to your OS buffering writes to the file.
Other configuration options:
:binary - boolean. If true, log files are opened in binary mode. (Useful for Marshal.dump) :separator - string. Appended to each write. Defaults to \n. Use something else in :binary mode.
Contributing to file_series
Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
Fork the project.
Start a feature/bugfix branch.
Commit and push until you are happy with your contribution.
Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2012 TED Conferences. See LICENSE.txt for further details.