Double logging in gurobi

Double logging in gurobi#

When using the gurobi solver you may see some of the logs generated by gurobi during the solve are duplicated.


Total elapsed time = 498.27s
[INFO] Total elapsed time = 498.27s

This is because the gurobi logger both prints to the console and propagates to the root logger.

Adding the following to your application code before call solve should fix the issue.

logger = logging.getLogger("gurobipy")
logger.propagate = False