Skip to main content

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

Ongoing

Comments

2 comments

  • 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

Please sign in to leave a comment.