Skip to content

Commit 6c2e3fc

Browse files
authored
Merge pull request #498 from steffanschlein/add-set-logfile
Add method to model for setting the logfile
2 parents 527a261 + 4ba3b39 commit 6c2e3fc

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
### Added
5+
- add SCIP function `SCIPsetMessagehdlrLogfile`
56
### Fixed
67
- fix `Model.writeLP` method
78
### Changed

src/pyscipopt/scip.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ cdef extern from "scip/scip.h":
512512
SCIP_RETCODE SCIPsetMessagehdlr(SCIP* scip, SCIP_MESSAGEHDLR* messagehdlr)
513513
void SCIPsetMessagehdlrQuiet(SCIP* scip, SCIP_Bool quiet)
514514
void SCIPmessageSetErrorPrinting(errormessagecallback, void* data)
515+
void SCIPsetMessagehdlrLogfile(SCIP* scip, const char* filename)
515516
SCIP_Real SCIPversion()
516517
void SCIPprintVersion(SCIP* scip, FILE* outfile)
517518
SCIP_Real SCIPgetTotalTime(SCIP* scip)

src/pyscipopt/scip.pyx

+7
Original file line numberDiff line numberDiff line change
@@ -4376,6 +4376,13 @@ cdef class Model:
43764376
PY_SCIP_CALL(SCIPsetMessagehdlr(self._scip, myMessageHandler))
43774377
SCIPmessageSetErrorPrinting(relayErrorMessage, NULL)
43784378

4379+
def setLogfile(self, path):
4380+
"""sets the log file name for the currently installed message handler
4381+
:param path: name of log file, or None (no log)
4382+
"""
4383+
c_path = str_conversion(path) if path else None
4384+
SCIPsetMessagehdlrLogfile(self._scip, c_path)
4385+
43794386
# Parameter Methods
43804387

43814388
def setBoolParam(self, name, value):

0 commit comments

Comments
 (0)