-
Notifications
You must be signed in to change notification settings - Fork 676
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
Live Logging - Log File Created Only Upon Program Termination #1086
Comments
This looks like a buffering issue, which I assume is specific to your environment (I'm personally not observing the behavior you described). What about the following snippet? Can you see the file before the end of the program? import time
f = open("file.log")
f.write("Some message\n")
time.sleep(10)
exit(0) |
Same issue, you're probably right, it might be a Mac OS or an environment related issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I want the log to be live.
I'm currently logging but the file is being created only upon termination.
During debugging for example I cannot see the file, but can see logging in the terminal, and when I terminate the debugger, then and only then the file is being created with all the logging that have been made.
I've tried to create the file before using Loguru, but results are the same.
How can I use live logging?
Thanks.
Mac OS Sonoma 14.3.1
PyCharm Pro
code snippet:
(I would expect that before sleep ends the log file is already created and written to, but it actually happens only after exit(0))
The text was updated successfully, but these errors were encountered: