Logging

By default, the imfusion module will write all log messages generated by the ImFusionLib C++ backend to stdout. If you require more control over the logging, you can transfer logging control to Python’s logging module with imfusion.transfer_logging_to_python():

>>> imfusion.log_error("test")  
test
>>> imfusion.transfer_logging_to_python()
>>> imfusion.log_error("test")  # won't write anything because logging is not initialized
>>> import logging
>>> logging.basicConfig()  # or some other configuration
>>> imfusion.log_error("test")  
ERROR:ImFusion:test

All messages will be written to the “ImFusion” logger.