# How to set verbose=false for \`Mosek\` in \`Convex.jl\`

**URL:** <https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378>\
**Category:** Optimization (Mathematical)\
**Created:** [September 10, 2020, 1:05pm UTC](https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378 "2020-09-10T13:05:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 10, 2020, 1:05pm UTC](https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378/1 "2020-09-10T13:05:56Z")

</div>

I’m using `Convex.jl` to solve convex optimisation problems.  
In `Convex.jl`, I can use various solvers, but I cannot make the solver `verbose=false` only when using Mosek.

How can I do this?

Here’s an MWE:

```julia
using Convex
using Mosek
using MosekTools
const SOLVER = Mosek
m = 5; n = 4
x = Variable(n, 1)
A = randn(m, n); b = randn(m, 1)
prob = minimize(sumsquares(A * x - b), [x <= 0])
prob = solve!(prob, SOLVER.Optimizer(verbose=false))

```

P.S. Can I copy contents in REPL to attach a result here? For reference, I’m using vim and Julia REPL now.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 10, 2020, 1:14pm UTC](https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378/2 "2020-09-10T13:14:49Z")

</div>

Mosek uses `LOG=0`, i.e. instead of `verbose=false`, write `LOG=0`. Note that this is a solver-specific choice, not a choice Convex made, although we should expose a generic way to suppress output (edit: here’s an issue for that: [https://github.com/jump-dev/Convex.jl/issues/403](https://github.com/jump-dev/Convex.jl/issues/403)).

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 10, 2020, 2:08pm UTC](https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378/3 "2020-09-10T14:08:15Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 10, 2020, 11:32pm UTC](https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378/4 "2020-09-10T23:32:58Z")

</div>

If you update to version 0.13.7 of Convex you can try the new keyword argument `silent_solver` for `solve!`, e.g.

```julia
solve!(prob, SOLVER.Optimizer(), silent_solver = true)

```

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [March 6, 2021, 8:18am UTC](https://discourse.julialang.org/t/how-to-set-verbose-false-for-mosek-in-convex-jl/46378/5 "2021-03-06T08:18:55Z")

</div>

Hi, @ericphanson!  
I’ve found that `solve!` with `silent_solver=true` or `LOG=false` cannot prevent other warning messages from MOSEK such as `MOSEK warning 705: #1 (nearly) zero elements are specified in sparse row ''(11) of matrix 'A'.`.

Can you share ideas to make them not to provide warning messages?
