-
Notifications
You must be signed in to change notification settings - Fork 213
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
GMT API callback to get error messages #49
Comments
leouieda
added a commit
that referenced
this issue
Nov 23, 2017
Fixes #49 Uses `GMT_Handle_Messages` to send error messages to a log file. In `call_module` retrieve those messages and use them in the exceptions for a more informative message (instead of just a status code). Implements a context manager method `LibGMT.log_to_file` that creates a temp file and sets up logging. Logs only a single API call so it must be used inside each method that wants to log. Actually only useful for `call_module`. Most other API calls don't produce error messages. Example: with self.log_to_file() as logfile: status = self._c_call_module(...) with open(logfile) as f: log = f.read()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paul implemented a new API function that might be useful. For now, we only include the error code in the traceback while GMT prints the error message to stderr. It would be better to capture that message and include it in the exceptions.
Could include a call using GMT_LOG_SET into
gmt.clib.LibGMT
to capture the messages.The text was updated successfully, but these errors were encountered: