Allow capturing logs as string
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 432
- PR merge metrics
- No merged PRs in 30d
Description
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()](https://docs.python.org/3/library/subprocess.html#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
Contributor guide
Research direction
Start by reading issue #188 and the solver output handling that currently writes to stdout or a temporary log file. Compare the requested behavior with Python's subprocess.check_output() and a StringIO-style file object. Done means PuLP exposes a way to retrieve the complete solver output as a string or file-like object instead of sending it directly to stdout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100