1

I want the SCIP callable to print all messages to stderr (using it as a flatzinc solver). I've tried

SCIP_DECL_MESSAGEWARNING(printMsg) {
  cerr << msg << flush;
}
...
      SCIP_MESSAGEHDLR* pHndl=0;
      SCIP_CALL ( SCIPmessagehdlrCreate ( &pHndl, FALSE, NULL, FALSE, printMsg, printMsg, printMsg, NULL, NULL) );

without effect...

glebB
  • 23
  • 5

1 Answers1

1

Try alse making SCIP aware of your message handler:

  SCIP_CALL( SCIPsetMessagehdlr(scip, pHndl) );

This will make SCIP also capture your message handler, so if you don't need it anymore, you can release it:

  SCIP_CALL( SCIPmessagehdlrRelease(&pHndl) );

This will not overwrite the handler for error messages, as these might have to be printed when no SCIP is around yet. You can set a handler for this one via SCIPmessageSetErrorPrinting(). But they already go to stderr.

stefan
  • 799
  • 4
  • 9
  • Would be helpful to add this to the description of SCIPmessagehdlrCreate because now it only says it also captures the created handle – glebB Jan 28 '16 at 23:44