FMPy icon indicating copy to clipboard operation
FMPy copied to clipboard

setDebugLogging filtering

Open GarronFish opened this issue 2 years ago • 1 comments

When modifying the https://github.com/CATIA-Systems/FMPy/blob/main/fmpy/examples/coupled_clutches.py example so that it logs only errors I find that logging is activate for all messages.

To reproduce ths issue. Modify coupled_clutches.py by changing line 44 to: fmu.instantiate(visible=False,loggingOn=True) and inserting the following line after line 44: fmu.setDebugLogging(loggingOn=True,categories=['logStatusError'])

when this is run the python output screen shows a lot of logging calls: ... [OK] fmi2DoStep: currentCommunicationPoint = 1.1, communicationStepSize = 0.001, newStep = fmi2True [OK] fmi2GetReal: #r17# = 1 [OK] fmi2GetReal: #r8# = 2.000000000000001 Threshold reached at t = 1.101 s [OK] fmi2Terminate [OK] fmi2FreeInstance Press any key to continue . . .

I was expecting only errors to be displayed because setDebugLogging was set with categories=['logStatusError'] Is this a bug or user error? Or an FMU issue? Thanks

GarronFish avatar Mar 14 '23 14:03 GarronFish

This would be an FMU issue - the FMU should only be calling the log callback for the enabled categories. See https://fmi-standard.org/docs/3.0.1/#fmi3SetDebugLogging

molokov avatar Dec 19 '24 04:12 molokov