Feature #1144

Gain access to information currently printed to stderr

Added by Paul 3 months ago. Updated 3 months ago.

Status:In ProgressStart date:2017-08-16
Priority:NormalDue date:
Assignee:Paul% Done:

0%

Category:-
Target version:Candidate for next minor release
Platform:

Description

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?

History

#1 Updated by Paul 3 months ago

I can think of a few ways to do this. Some are module specific and others are API level:

  1. 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.
  2. 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.
  3. 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.

#2 Updated by Paul 3 months ago

  • Status changed from New to In Progress

Added experimental GMT_Handle_Errors function to address option 3 above.

Also available in: Atom PDF