Errors

cacelp
Errors and warnings in Open Babel are handled internally by a flexible system motivated by a few factors:

End users often do not wish to be deluged by debugging or other messages during operation.

Other developers may wish to redirect or filter error/warning output (e.g., in a GUI).

The operation of Open Babel should be open to developers and users alike to monitor an "audit trail" of operations on files and molecules, and debug the program and library itself when the need arises.

The OBMessageHandler class includes documentation on the new error system, which is summarized below:

Multiple error/warning levels exist and should be used by code. Rough divisions include:

The __FUNCTION__ builtin is defined by many compilers (e.g., GCC) but can be defined to an empty string on some platforms without this compiler extension. It is currently used to provide information about which function is yielding the error or debugging information. This extension should eventually be replaced in the Open Babel code by __func__ which is now part of the C99 standard.