Feature #1144

Gain access to information currently printed to stderr

Added by Paul about 4 years ago. Updated over 3 years ago.

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


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:

  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 about 4 years ago

  • Status changed from New to In Progress

Added experimental GMT_Handle_Errors function to address option 3 above.

#3 Updated by Paul over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Fully working per Leo. Closing.

Also available in: Atom PDF