pulp
pulp copied to clipboard
Allow capturing logs as string
Describe the new feature
Similar to #188, I want to be able to capture the PuLP output and put it all in a single log line, rather than having it go to stdout directly. Instead of creating a temporary file and pointing PuLP to the log file, I would like to be able to get the log output as a string, similar to how you can do it with subprocess.check_output(). Alternatively, we could provide a file object (like StringIO) if that's easier.
Additional info
Please answer these questions before submitting your feature request.
Is your feature request related to an issue? Please include the issue number.
#188
Does this feature exist in another product or project? Please provide a link.
Python has a native way of getting output from subprocess command calls: https://docs.python.org/3/library/subprocess.html#subprocess.check_output
This make sense, many commercial solvers already provide a file object interface, if I remember correctly. I'd love to check a PR if you feel like helping out : )
Is this feature implemented in https://github.com/coin-or/pulp/pull/525?