MityDSP Documentation Index

tcDspError

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.

See also:
MityDSP::tcDspError Class Reference

Example

This is a simple example of tcDspError usage:

 // 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)
/// 

  
Generated on Fri Sep 23 16:33:44 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.