CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.25k stars 294 forks source link

Support configuring console output verbosity #1397

Closed ubruhin closed 1 year ago

ubruhin commented 1 year ago

Currently the console output is quite verbose, at least when performing a STEP export. To avoid the "noise" on the console output, we would like to configure the logging level.

I found out that this is possible by accessing OCP directly:

from OCP.Message import Message, Message_Gravity

for printer in Message.DefaultMessenger_s().Printers():
    printer.SetTraceLevel(Message_Gravity.Message_Fail)

So this is not a critical issue at all, but I think it would be nice to have this feature in the API of CadQuery.

Links to OCCT documentation:

adam-urbanczyk commented 1 year ago

How about simply setting the level to Message_Gravity.Message_Fail in CQ without adding new methods?

ubruhin commented 1 year ago

Good point, I think that would be fine for me! :+1:

It's probably a good default anyway for CadQuery, and if the need for configurability arises, it could still be added to the public API later.