@section intro_sec Introduction The tcDspError class is used to create and log error, warning, status and debug messages in a consistent format. A callback may be employed to take the formatted error message and process it in an application- specific manner. If no callback is installed, a simple "printf" is performed. Messages are only produced if the error severity is greater than or equal to the currently configured threshold. The occurance of an error (file and line number) may be logged, regardless of threshold setting, using a second application-provided callback function. @sa MityDSP::tcDspError Class Reference @section example_sec Example This is a simple example of tcDspError usage: @code
// simple tcDspError callback void send_error (enum teErrorValues aeSeverity, const char aaErrString[]) { // send error to standard out printf ("%s", aaErrString); return; }
{ ...
// register error callback tcDspError::mfCallback = send_error;
// set error reporting level tcDspError::meSendToStdout = status;
tcDspError::report (FILE, LINE, status, "Initialization complete (version %1d.%1d)", VERSION_ID_MAJOR, VERSION_ID_MINOR); ... }
This example results in the following standard output:
/// (12:34:56) DspExample.cpp::234: *** STATUS *** /// Initialization complete (version 0.1) ///