[Rd] Catching warning and error output

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Oct 11 18:00:53 CEST 2005


Dear R developers,

since nobody has pointed me to an existing solution so far, here is a more 
specific suggestion. Attached you will find two patches against R version 
2.2.0.

The first patch does two things:
1) Add a function R_WriteErrConsole similar to R_WriteConsole, and a 
corresponding ptr_R_WriteErrConsole.
2) Make inError, inWarning, and inPrintWarnings from errors.c accessible 
(read-only) in R_ext/Error.h
I believe these changes to be minimally invasive. I did not test-compile on 
windows, but the change in gnuwin32 should be trivial.

The second patch adds a test/example to tests/Embedding, showing how this 
added API can be used to identify warnings and errors in the output stream.

If you need any further comments / different format of patches, or anything 
else in order to evaluate this proposal, please let me know.

Thanks!
Thomas


More information about the R-devel mailing list