Gain access to information currently printed to stderr
|Target version:||Candidate for next minor release|
How can we obtain information (say, coefficients reported by trend2d via -V) back to the caller of the API? Can we come up with a general API-level solution across the modules?
#1 Updated by Paul about 4 years ago
I can think of a few ways to do this. Some are module specific and others are API level:
- There are not that many modules that write data that might be of use to the developer, but those that do could possibly add a new option to write that information to a file (which from the API point of view could be a virtual file) and then the programmer can parse that file directly.
- At the time of GMT_Create_Session the programmer can specify that all stderr output is sent to a log file instead. One can then hunt for the required information in the log file, and we could ensure that the buffer is flushed when a module ends.
- We could add a new API function that temporarily redirects a module's verbose output to a specified filename. Upon exit form the module the file is closed and the mode is reset to write to stderr again.
I guess we should identify how many modules do or could write out parameters of interest to developers and if not too many then option #1 seems more reasonable.