Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for stdout (engOutputBuffer) #10

Open
bbarker opened this issue May 1, 2020 · 3 comments
Open

Add API for stdout (engOutputBuffer) #10

bbarker opened this issue May 1, 2020 · 3 comments

Comments

@bbarker
Copy link
Collaborator

bbarker commented May 1, 2020

Currently there is no way to retrieve stdout of the MATLAB process; for this we need engOutputBuffer, and possibly some convenience APIs written atop it to make dealing with buffers less burdensome.

@bbarker
Copy link
Collaborator Author

bbarker commented May 1, 2020

An alternative, possibly more appealing in certain cases anyway (and certainly appearing simpler) is the MATLAB diary, which basically tells MATLAB to log all output to a specified file - I'll explore this soon.

@bbarker
Copy link
Collaborator Author

bbarker commented May 1, 2020

Confirmed that diary works well for most use cases. Using Path, a couple of example functions would be:

diaryFile :: Engine -> Path b File -> MIO ()
diaryFile e logFile = engineEval e $ "diary " <> (toFilePath logFile)

diaryOn :: Engine -> MIO ()
diaryOn e = engineEval e "diary on"

@bbarker
Copy link
Collaborator Author

bbarker commented May 29, 2020

Does engOutputBuffer include stderr? What sorts of things are logged to stederr in MATLAB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant