-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature: Add new header / first line #6
Comments
I would rather prefer this to be implemented by user as a custom |
Yes, using onSuccess was my first thought, but then I noticed that onSuccess is not in the synchronization block which may cause some issues. Maybe I'm wrong? Sure no worries, it is not urgent. If you prefer a PR then please let me know it. It should not be (too) much effort for me. |
Hey @pitschr, will you be able to spare some time to check the changes? Or shall I just put a ribbon around it and make a new release? |
Hey. Sure, as long the library is not used by thousand of developers I won't suggest to take the backward-compatibility seriously and when considering the semantic versioning, then your library has not reached the public release (1.x) anyway. In nutshell, go ahead with changes you want to do. As the onSuccess() method is now in the synchronized block I can create a custom RotationCallback as initially suggested by you. I'll check out it in next days. Thank you for your support. |
I made quick tests and they are working on Windows machine as well. Appending headers was not a problem anymore. For the test I used
Few proposals: Only one issue I encountered was that header might be added twice times when APPEND mode was used. Therefore it may be highlighted as a comment in JavaDoc so that developers have to think about this scenario as well. Meaning, they either have to provide two RotationCallbacks implementations if the If you want to make it more comfortable, then perhaps add From my side you can go ahead with releasing the version 0.9 as I am not using the "append" feature at the moment. |
Thanks for the great feedback and review @pitschr, I really appreciated that. I prefer not to expose the internals (i.e. I have released 0.9.0 in Sonatype, it should show up momentarily in Maven Central. |
Hello.
Does your library offer the possibility to add a header line (or first line) after e.g. daily rotation?
In my case I am using your library for auditing which offers few formats, including CSV format. As you know CSV are not really human-friendly as it contains only comma-separated values it would be very beneficial to add header automatically when a file rotation happens.
E.g.
after daily file rotation the header line should be re-added. Actually I see only the possibility to add header when I start writing the file, but doesn't re-apply when daily rotation happens.
If not, I could imagine to add this functionality either as part of
RotationConfig
orRotationCallback
. And the logic if the header line should be added or not may happen in methodcom.vlkan.rfos.RotatingFileOutputStream#unsafeRotate
Let me know if you are interested in adding this feature or do you prefer a PR?
The text was updated successfully, but these errors were encountered: