AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers
BSD 3-Clause "New" or "Revised" License
2.09k stars 357 forks source link

Mute partio error prints #1774

Closed olegul closed 7 months ago

olegul commented 7 months ago

Description

This patch mutes the error printed to std::err from inside Partio when it fails to read a pointcloud. OSL's pointcloud_search and pointcloud_find already reports errors "the proper way" via errorfmt, so a failed read will still thrown an error. Plain prints like this can sneak past log-limiting filtering and result in very large log files.

Currently, running something like

shader partioerror(){ float test[1]; if(pointcloud_search("non-existing",P,1.0,1,"test",test)) printf("Success"); }

in testshade, will print

Partio: No extension detected in filename ERROR: pointcloud_search: could not open "non-existing"

with the patch, it will just print ERROR: pointcloud_search: could not open "non-existing"

Tests

I haven't added any tests yet

Checklist:

linux-foundation-easycla[bot] commented 7 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

lgritz commented 7 months ago

@olegul You need to click the right things to add yourself to the CI. You're already approved on the SPI end, but you need to accept it.