-
Notifications
You must be signed in to change notification settings - Fork 6
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
File Logger not working as expected #128
Comments
This can be reproduced with the
|
|
So this is strange because although
Now create a little Python script
This unexpectedly does not read the
and
|
Is the log being written to file asynchronously, or when the program closes? Perhaps the log file needs to be flushed to disk? |
Looks like |
The first error in RDF reading is now saved to a log file. However, subsequent errors are not. import pyomexmeta
# setup logger
pyomexmeta.RDF.from_file(bad_file)
pyomexmeta.Logger.flush()
# log file is non-empty
pyomexmeta.RDF.from_file(bad_file_2)
pyomexmeta.Logger.flush()
# log file is empty I have this in a unittest. I'll try to distill this to a minimal example. |
We don't have the flushing problem in C++ - it seems. We might have the flushing problem in the C layer but I checked Python first, which works as I expected (so I assume C is also okay). Basically I have behaviour that looks like this (v1.2.13):
output:
output
output
output:
|
Once I realized you added methods for getting the log data, I switched to using that. That seems to work well. Here's a minimal example for the file logger issue.
|
Here's an invalid RDF file for the above example: invalid.rdf |
I tried the example in the "Switching to the file logger" section. Nothing is saved to the log file.
pyomexmeta: 1.2.12
python: 3.9.5
OS: Ubuntu
Originally posted by @jonrkarr in #87 (comment)
The text was updated successfully, but these errors were encountered: