Skip to main content

How to surpress direct output to stdout if logging enabled - Python API

Ongoing

Comments

3 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Grzegorz,

    A workaround could be to define a dedicated logfile that your logger uses to print to. You could then ignore the stdout from Gurobi and only monitor the logfile.

    To do this you just need to specify a filename in the basicConfig call: logging.basicConfig(filename="info.log")

    I hope this helps.

    Cheers,
    Matthias

    0
  • Andrea Cassioli
    Gurobi-versary
    First Comment

    I am facing the same issue. Using a file is not a real solution: I would like my application to either log to console or to file. So if I select console I get a polluted output. I guess some of the output is not piped via the `logging` module. 

    Any other suggestions?

    0

Post is closed for comments.