From 276a3d49bd7530a753ad4fe55164cc2b6879466a Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Thu, 31 Oct 2024 16:04:57 -0700 Subject: [PATCH] [solvers] Fix Gurobi console logging obey our defaults again --- solvers/gurobi_solver.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/solvers/gurobi_solver.cc b/solvers/gurobi_solver.cc index a2d10340fbaf..710bd519bc3d 100644 --- a/solvers/gurobi_solver.cc +++ b/solvers/gurobi_solver.cc @@ -954,9 +954,7 @@ void GurobiSolver::DoSolve2(const MathematicalProgram& prog, // Copy the remaining options into model_env. options->Respell([](const auto& common, auto* respelled) { - if (common.print_to_console) { - respelled->emplace("LogToConsole", 1); - } + respelled->emplace("LogToConsole", common.print_to_console ? 1 : 0); if (!common.print_file_name.empty()) { respelled->emplace("LogFile", common.print_file_name); }