I have been running the urban flood risk mitigation model through Python scripting and each time it finishes there are no log files generated. I believe there is an example of saving log messages to the log file here: Tutorial: Batch Processing on Windows — InVEST 3.9.0.post226+g36cc3d2e documentation, however this only creates the logfile and it is still empty.
I am wondering if the reference for the urban flood risk model to log the steps of the calculation is
‘MODEL_LOGGER = logging.getLogger(‘natcap.invest.urban_flood_risk_mitigation’)’ because this did not work for me.
If there are any other implementations or ways to get a logfile in order to help debug, please let me know.
If you created your script by saving it through the User Interface (Development → Save to Python script) you should see something like this at the top of the file:
Thanks for the updated API call to get the logfile, but in my case I am not creating by script by saving it through the User Interface. Instead, I am running the urban flood risk mitigation model by calling the API natcap.invest.urban_flood_risk_mitigation.execute(args).
Would adding this before the execution of the API call of the flood risk model work?