-
Notifications
You must be signed in to change notification settings - Fork 43
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
Default path being created wrongly #119
Comments
That's a good point. Let me look into this and get back to you. |
I don't doubt what you're seeing, but looking at the code, the |
@darkfrog26 I suspect the reason is the usage of It might seem highly improbable that app writes something between call of Hence, it is likely, that if app wrote the stuff before the calls to scribe, it starts to write immediately before the reconfiguration is finished. All these are a random guesses though... I guess I could make a small project to reproduce the effect, so I can share it. |
I have created a minimal project to reproduce the issue. It seems that |
@darkfrog26 I found the problem. It is the following line:
The |
Ah, that makes me feel better. I remember that being a problem before, but could have sworn I solved it....apparently I did. :) No worries man, I'm glad it's working now. |
Consider the following line of code:
The approach defined in documentation:
https://github.com/outr/scribe/wiki/getting-started#logging-to-a-file
This will cause the two
LogFile
instances being created. One whenFileWriter.apply
is called, and another when path is changed.The problem is that, it will also call
logFile.flush()
on the old instance causing, in some cases, for the path to be created.The current workaround is to use
new FileWriter
directly. It does not seem to be a right way though.Stack trace:
The text was updated successfully, but these errors were encountered: