Closed mhsmith closed 1 year ago
Based on the behavior, I'm guessing that you're doing a write to log on
flush()
? Is there a particular reason for outputting on flush, rather than newline?
It now outputs on flush
or newline, whichever comes first. The reasoning is that if the user calls flush
, that means they want to see the output immediately, and the only way we can do that is to output a partial line.
Previously it would output on every call to write
, which would break up lines much more.
With the updates to this PR, https://github.com/chaquo/chaquopy/issues/777, and other stuff, I didn't manage to complete the Chaquopy public release today. If nothing else comes up in final testing, it'll be available tomorrow.
It now outputs on
flush
or newline, whichever comes first. The reasoning is that if the user callsflush
, that means they want to see the output immediately, and the only way we can do that is to output a partial line.Previously it would output on every call to
write
, which would break up lines much more.
That's what I figured. I guess it's a bit of a value judgement - we have to make a judgement call between making the final output "clean", or capturing the immediacy for those small number of cases where it will matter (e.g., outputting the name of the test that will be run before it crashes). The std-nslog
wrapper only honors newline at present; I guess we can use the comparison between the two as a validation of which approach works better in practice.
DO NOT MERGE until Chaquopy 14.0.0 has been released publicly on Maven Central, and the temporary Maven URL in build.gradle has been removed.
Things to check:
ctypes.CDLL(ctypes.util.find_library("c")).printf(...)
.PR Checklist: