thicket icon indicating copy to clipboard operation
thicket copied to clipboard

Silence Laubwerk SDK

Open dvhart opened this issue 5 years ago • 4 comments

For every call to the Laubwerk SDK get_mesh() function, the SDK prints the following to the console:

[debug] Time to create control mesh: 1572ms
[debug] subdiv helper generation time : 0.002604s
[debug] subdiv helper generation time : 0.000803s

There is not option to specify the log level of the SDK.

The typical way to address this is via contextlib.redirect_std(out|err). Unfortunately, this doesn't work with the CPython SDK library.

There may not be a way to address this in Thicket, but tracking this here in case someone knows a way around it. Alternatively, we can reach out to Laubwerk to request a loglevel which honors the standard python log levels and pass in the Thicket log level setting to the SDK directly.

dvhart avatar May 30 '20 23:05 dvhart

I guess that is something we should do on the side of the Laubwerk Python extension. Will look into that!

tdapper avatar Jul 08 '20 14:07 tdapper

Just fyi: This has been added to our issue tracker as LBWPY-148.

tdapper avatar Oct 15 '20 17:10 tdapper

Just an an update: This has been solved internally and will be part of the next update (probably an upcoming version 1.0.42). What will happen, is that the laubwerk module gets a set_logger() function. You can pass a Python logger or really any other object in there. If that object has warning(), debug(), info() etc functions like the logger, those functions will get called. Therefore, to just get the extension to shut up, you can pass an object that doesn't have those functions and that will just silence it. If the function never is called or is called with None, it will fall back to just printing. However, it will now print those messages to stderr instead of stdout now.

tdapper avatar Apr 11 '22 13:04 tdapper

Thanks @tdapper will watch for it. Should be a simple patch to incorporate as we moved to loggers for Blender a little while back. Appreciate the heads up!

dvhart avatar Apr 21 '22 02:04 dvhart

Due to changes in the Laubwerk API and the lack of current API documentation, I am no longer able to develop or maintain Thicket. Consider trying Laubwerk’s fork of thicket:

https://github.com/Laubwerk/player-for-blender

Thank you for using Thicket, it was a lot of fun to develop.

dvhart avatar Jul 05 '24 18:07 dvhart