/*! \page page_tf_Diagnostic Guide To Diagnostic Facilities Describes the use of low-level programming macros to issue coding errors, runtime errors, warnings and status messages. \section DiagnosticContents Contents \li \ref DiagnosticQuickStart \li \ref DiagnosticIntendedUse \li \ref DiagnosticTF_FATAL_ERROR \li \ref DiagnosticTF_ERROR \li \ref DiagnosticTF_WARN \li \ref DiagnosticTF_STATUS \li \ref DiagnosticTF_FUNC_NAME \section DiagnosticQuickStart Quick Guide to Functions and Macros If you are already familiar with the TF library diagnostic facilities, here is a quick guide to picking the correct facility: \section DiagnosticIntendedUse Intended Use The intended use of the diagnostic facilities in the Tf Library is for documenting and communicating various abnormal conditions that can occur in your code. The facilities in the Tf Library, while effective, are fairly low-level. If your application or library has access to higher-level and more structured diagnostic facilities, you are urged to make use of them; if not, you should use the facilities in the Tf Library. Although these facilities are fairly simple, they are also highly configurable. The diagnostic facilities in the Tf Library are appropriate for the following tasks: \li Communicating coding errors (for example, unsatisfied program invariants) \li Communicating serious runtime errors whose cause is external (for example, a needed server can't be found, a vital configuration file is missing) \li Informing the user of problems that are not handled by other parts of the program. To communicate errors, warnings, and status messages, the Tf Library first attempts to call a delegate which may be installed by a higher-level library. If there is no delegate installed, default actions include printing errors and warnings to \c stderr, printing status messages to \c stdout, printing stack traces, and terminating the program on fatal errors. The following list describes usage scenarios for the diagnostic facilities in the Tf Library: \li For non-fatal coding errors (for example, something you didn't expect, non-fatal violation of an API requirement), use TF_CODING_ERROR(). \li For fatal coding errors (for example, an unexpected, unrecoverable coding error, violation of an API requirement which cannot be handled), use TF_FATAL_ERROR() or TF_AXIOM(). \li For fatal external errors (for example, you wanted to execute "/bin/cat", but it doesn't exist, the database server won't respond) use TF_FATAL_ERROR(). \li For non-fatal user errors or conditions (for example, a mesh has bad topology, but there is no facility for fixing it, a color is out of range, etc.) use TF_RUNTIME_ERROR() or to be more specific, TF_ERROR(). \li For warnings (conditions which might possibly be an error, but are not always so) use TF_WARN(). \li For anything else (not fatal, never an error, but useful to know) use TF_STATUS(). \section DiagnosticTF_FATAL_ERROR Fatal Errors Sometimes there is no reasonable way to proceed past a coding bug. In this case, use TF_FATAL_ERROR(). Again, be sure to give a clear and concise explanation of what went wrong. Following is an actual example from the Tf Library: \code #include "pxr/base/tf/diagnostic.h" template