Closed mcslee closed 1 year ago
I suspect this is because GLFW calls the error callback, and you have it set to print out all errors. Try changing it and skipping GLFW_FORMAT_UNAVAILABLE in the callback. Be aware that this may not be a perfect solution due to the ambiguity of that error code.
Ah, yes that's exactly right I do have a print handler in place for the error callback. I have updated that, setting a flag when I make this clipboard call to suppress the error log, as ignoring all GLFW_FORMAT_UNAVAILABLE potentially feels too broad.
Thanks for the quick response and great suggestion. Closing this out.
Version
3.3.1
Platform
macOS arm64
JDK
Temurin 17.0.4 Eclipse Adoptium
Module
GLFW
Bug description
The method
glfwGetClipboardString
produces error logs if the system clipboard content is not convertible a string (for instance, if it contains an image). It is expected that the method will returnNULL
in this case per the documentation, but there does not seem to be any way to suppress the call from producing error log output.If an application needs to poll to monitor for a clipboard change, this creates enormous log spew. Even in the case of just checking the system clipboard once in response to user action, it doesn't seem like an error log is appropriate if the method is documented as returning
NULL
if the clipboard content is not convertible to a string (and there seems to be no other way of checking whether this is the case other than invoking the method).The error log appears as follows:
Stacktrace or crash log output