RAVE
rave_debug.h File Reference

Defines the functions for debugging rave. More...

Go to the source code of this file.

Macros

#define RAVE_SPEWDEBUG0(msg)
 Spewdebug macro taking one text string.
 
#define RAVE_SPEWDEBUG1(msg, arg1)
 Spewdebug macro taking one text string and one argument.
 
#define RAVE_SPEWDEBUG2(msg, arg1, arg2)
 Spewdebug macro taking one text string and two arguments.
 
#define RAVE_SPEWDEBUG3(msg, arg1, arg2, arg3)
 Spewdebug macro taking one text string and three arguments.
 
#define RAVE_SPEWDEBUG4(msg, arg1, arg2, arg3, arg4)
 Spewdebug macro taking one text string and four arguments.
 
#define RAVE_DEBUG0(msg)
 Debug macro taking one text string.
 
#define RAVE_DEBUG1(msg, arg1)
 Debug macro taking one text string and one argument.
 
#define RAVE_DEBUG2(msg, arg1, arg2)
 Debug macro taking one text string and two arguments.
 
#define RAVE_DEBUG3(msg, arg1, arg2, arg3)
 Debug macro taking one text string and three arguments.
 
#define RAVE_DEBUG4(msg, arg1, arg2, arg3, arg4)
 Debug macro taking one text string and four arguments.
 
#define RAVE_DEBUG7(msg, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
 Debug macro taking one text string and seven arguments.
 
#define RAVE_DEPRECATED0(msg)
 Deprecated macro taking one text string.
 
#define RAVE_DEPRECATED1(msg, arg1)
 Deprecated macro taking one text string and one argument.
 
#define RAVE_DEPRECATED2(msg, arg1, arg2)
 Deprecated macro taking one text string and two arguments.
 
#define RAVE_DEPRECATED3(msg, arg1, arg2, arg3)
 Deprecated macro taking one text string and three arguments.
 
#define RAVE_DEPRECATED4(msg, arg1, arg2, arg3, arg4)
 Deprecated macro taking one text string and four arguments.
 
#define RAVE_INFO0(msg)
 Info macro taking one text string.
 
#define RAVE_INFO1(msg, arg1)
 Info macro taking one text string and one argument.
 
#define RAVE_INFO2(msg, arg1, arg2)
 Info macro taking one text string and two arguments.
 
#define RAVE_INFO3(msg, arg1, arg2, arg3)
 Info macro taking one text string and three arguments.
 
#define RAVE_INFO4(msg, arg1, arg2, arg3, arg4)
 Info macro taking one text string and four arguments.
 
#define RAVE_INFO7(msg, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
 Info macro taking one text string and seven arguments.
 
#define RAVE_WARNING0(msg)
 Warning macro taking one text string.
 
#define RAVE_WARNING1(msg, arg1)
 Warning macro taking one text string and one argument.
 
#define RAVE_WARNING2(msg, arg1, arg2)
 Warning macro taking one text string and two arguments.
 
#define RAVE_WARNING3(msg, arg1, arg2, arg3)
 Warning macro taking one text string and three arguments.
 
#define RAVE_WARNING4(msg, arg1, arg2, arg3, arg4)
 Warning macro taking one text string and four arguments.
 
#define RAVE_ERROR0(msg)
 Error macro taking one text string.
 
#define RAVE_ERROR1(msg, arg1)
 Error macro taking one text string and one argument.
 
#define RAVE_ERROR2(msg, arg1, arg2)
 Error macro taking one text string and two arguments.
 
#define RAVE_ERROR3(msg, arg1, arg2, arg3)
 Error macro taking one text string and three arguments.
 
#define RAVE_ERROR4(msg, arg1, arg2, arg3, arg4)
 Error macro taking one text string and four arguments.
 
#define RAVE_CRITICAL0(msg)
 Critical macro taking one text string.
 
#define RAVE_CRITICAL1(msg, arg1)
 Critical macro taking one text string and one argument.
 
#define RAVE_CRITICAL2(msg, arg1, arg2)
 Critical macro taking one text string and two arguments.
 
#define RAVE_CRITICAL3(msg, arg1, arg2, arg3)
 Critical macro taking one text string and three arguments.
 
#define RAVE_CRITICAL4(msg, arg1, arg2, arg3, arg4)
 Critical macro taking one text string and four arguments.
 
#define RAVE_ASSERT(expr, msg)
 
#define RAVE_ABORT()
 

Typedefs

typedef enum Rave_Debug Rave_Debug
 Debug levels.
 
typedef void(* rave_dbgfun) (const char *filename, int lineno, Rave_Debug lvl, const char *fmt,...)
 The debugger function.
 

Enumerations

enum  Rave_Debug {
  RAVE_SPEWDEBUG =0 , RAVE_DEBUG , RAVE_DEPRECATED , RAVE_INFO ,
  RAVE_WARNING , RAVE_ERROR , RAVE_CRITICAL , RAVE_SILENT
}
 Debug levels. More...
 

Functions

void Rave_printf (const char *fmt,...)
 The printer function.
 
void Rave_initializeDebugger (void)
 Initializes the debugger structure, must have been called before executing the code.
 
void Rave_setDebugLevel (Rave_Debug lvl)
 Sets the debug level.
 
Rave_Debug Rave_getDebugLevel (void)
 
void Rave_setDebugFunction (rave_dbgfun dbgfun)
 Sets the debug function where the debug printouts should be routed.
 
rave_dbgfun Rave_getDebugFunction (void)
 

Detailed Description

Defines the functions for debugging rave.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2009-10-15

Macro Definition Documentation

◆ RAVE_ABORT

#define RAVE_ABORT ( )
Value:
abort()

◆ RAVE_ASSERT

#define RAVE_ASSERT ( expr,
msg )
Value:
if(!expr) { \
Rave_getDebugFunction()(__FILE__, __LINE__, RAVE_CRITICAL, msg); \
abort(); \
}
@ RAVE_CRITICAL
If this occurs, then something has gone very wrong or the code contains a bug, please report it to th...
Definition rave_debug.h:41

◆ RAVE_CRITICAL0

#define RAVE_CRITICAL0 ( msg)
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_CRITICAL,msg)
rave_dbgfun Rave_getDebugFunction(void)
Definition rave_debug.c:144

Critical macro taking one text string.

◆ RAVE_CRITICAL1

#define RAVE_CRITICAL1 ( msg,
arg1 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_CRITICAL,msg,arg1)

Critical macro taking one text string and one argument.

◆ RAVE_CRITICAL2

#define RAVE_CRITICAL2 ( msg,
arg1,
arg2 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_CRITICAL,msg,arg1,arg2)

Critical macro taking one text string and two arguments.

◆ RAVE_CRITICAL3

#define RAVE_CRITICAL3 ( msg,
arg1,
arg2,
arg3 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_CRITICAL,msg,arg1,arg2,arg3)

Critical macro taking one text string and three arguments.

◆ RAVE_CRITICAL4

#define RAVE_CRITICAL4 ( msg,
arg1,
arg2,
arg3,
arg4 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_CRITICAL,msg,arg1,arg2,arg3,arg4)

Critical macro taking one text string and four arguments.

◆ RAVE_DEBUG0

#define RAVE_DEBUG0 ( msg)

Debug macro taking one text string.

◆ RAVE_DEBUG1

#define RAVE_DEBUG1 ( msg,
arg1 )

Debug macro taking one text string and one argument.

◆ RAVE_DEBUG2

#define RAVE_DEBUG2 ( msg,
arg1,
arg2 )

Debug macro taking one text string and two arguments.

◆ RAVE_DEBUG3

#define RAVE_DEBUG3 ( msg,
arg1,
arg2,
arg3 )

Debug macro taking one text string and three arguments.

◆ RAVE_DEBUG4

#define RAVE_DEBUG4 ( msg,
arg1,
arg2,
arg3,
arg4 )

Debug macro taking one text string and four arguments.

◆ RAVE_DEBUG7

#define RAVE_DEBUG7 ( msg,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7 )

Debug macro taking one text string and seven arguments.

◆ RAVE_DEPRECATED0

#define RAVE_DEPRECATED0 ( msg)

Deprecated macro taking one text string.

◆ RAVE_DEPRECATED1

#define RAVE_DEPRECATED1 ( msg,
arg1 )

Deprecated macro taking one text string and one argument.

◆ RAVE_DEPRECATED2

#define RAVE_DEPRECATED2 ( msg,
arg1,
arg2 )

Deprecated macro taking one text string and two arguments.

◆ RAVE_DEPRECATED3

#define RAVE_DEPRECATED3 ( msg,
arg1,
arg2,
arg3 )

Deprecated macro taking one text string and three arguments.

◆ RAVE_DEPRECATED4

#define RAVE_DEPRECATED4 ( msg,
arg1,
arg2,
arg3,
arg4 )

Deprecated macro taking one text string and four arguments.

◆ RAVE_ERROR0

#define RAVE_ERROR0 ( msg)
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_ERROR,msg)
@ RAVE_ERROR
Errors can be when memory not could be allocated or a file not could be created.
Definition rave_debug.h:40

Error macro taking one text string.

◆ RAVE_ERROR1

#define RAVE_ERROR1 ( msg,
arg1 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_ERROR,msg,arg1)

Error macro taking one text string and one argument.

◆ RAVE_ERROR2

#define RAVE_ERROR2 ( msg,
arg1,
arg2 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_ERROR,msg,arg1,arg2)

Error macro taking one text string and two arguments.

◆ RAVE_ERROR3

#define RAVE_ERROR3 ( msg,
arg1,
arg2,
arg3 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_ERROR,msg,arg1,arg2,arg3)

Error macro taking one text string and three arguments.

◆ RAVE_ERROR4

#define RAVE_ERROR4 ( msg,
arg1,
arg2,
arg3,
arg4 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_ERROR,msg,arg1,arg2,arg3,arg4)

Error macro taking one text string and four arguments.

◆ RAVE_INFO0

#define RAVE_INFO0 ( msg)
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_INFO,msg)
@ RAVE_INFO
Informational messages.
Definition rave_debug.h:38

Info macro taking one text string.

◆ RAVE_INFO1

#define RAVE_INFO1 ( msg,
arg1 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_INFO,msg,arg1)

Info macro taking one text string and one argument.

◆ RAVE_INFO2

#define RAVE_INFO2 ( msg,
arg1,
arg2 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_INFO,msg,arg1,arg2)

Info macro taking one text string and two arguments.

◆ RAVE_INFO3

#define RAVE_INFO3 ( msg,
arg1,
arg2,
arg3 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_INFO,msg,arg1,arg2,arg3)

Info macro taking one text string and three arguments.

◆ RAVE_INFO4

#define RAVE_INFO4 ( msg,
arg1,
arg2,
arg3,
arg4 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_INFO,msg,arg1,arg2,arg3,arg4)

Info macro taking one text string and four arguments.

◆ RAVE_INFO7

#define RAVE_INFO7 ( msg,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_INFO,msg,arg1,arg2,arg3,arg4,arg5,arg6,arg7)

Info macro taking one text string and seven arguments.

◆ RAVE_SPEWDEBUG0

#define RAVE_SPEWDEBUG0 ( msg)

Spewdebug macro taking one text string.

◆ RAVE_SPEWDEBUG1

#define RAVE_SPEWDEBUG1 ( msg,
arg1 )

Spewdebug macro taking one text string and one argument.

◆ RAVE_SPEWDEBUG2

#define RAVE_SPEWDEBUG2 ( msg,
arg1,
arg2 )

Spewdebug macro taking one text string and two arguments.

◆ RAVE_SPEWDEBUG3

#define RAVE_SPEWDEBUG3 ( msg,
arg1,
arg2,
arg3 )

Spewdebug macro taking one text string and three arguments.

◆ RAVE_SPEWDEBUG4

#define RAVE_SPEWDEBUG4 ( msg,
arg1,
arg2,
arg3,
arg4 )

Spewdebug macro taking one text string and four arguments.

◆ RAVE_WARNING0

#define RAVE_WARNING0 ( msg)
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_WARNING,msg)
@ RAVE_WARNING
Warnings.
Definition rave_debug.h:39

Warning macro taking one text string.

◆ RAVE_WARNING1

#define RAVE_WARNING1 ( msg,
arg1 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_WARNING,msg,arg1)

Warning macro taking one text string and one argument.

◆ RAVE_WARNING2

#define RAVE_WARNING2 ( msg,
arg1,
arg2 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_WARNING,msg,arg1,arg2)

Warning macro taking one text string and two arguments.

◆ RAVE_WARNING3

#define RAVE_WARNING3 ( msg,
arg1,
arg2,
arg3 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_WARNING,msg,arg1,arg2,arg3)

Warning macro taking one text string and three arguments.

◆ RAVE_WARNING4

#define RAVE_WARNING4 ( msg,
arg1,
arg2,
arg3,
arg4 )
Value:
Rave_getDebugFunction()(__FILE__,__LINE__,RAVE_WARNING,msg,arg1,arg2,arg3,arg4)

Warning macro taking one text string and four arguments.

Typedef Documentation

◆ rave_dbgfun

typedef void(* rave_dbgfun) (const char *filename, int lineno, Rave_Debug lvl, const char *fmt,...)

The debugger function.

Parameters
[in]filename- the name of the file
[in]lineno- the line number
[in]lvl- the debug level for this message
[in]fmt- the varargs formatter string
[in]...- the varargs list

◆ Rave_Debug

typedef enum Rave_Debug Rave_Debug

Debug levels.

The levels are defined so that if RAVE_INFO debug level is turned on, all higher levels will also be printed except RAVE_SILENT which means turn of logging.

Enumeration Type Documentation

◆ Rave_Debug

enum Rave_Debug

Debug levels.

The levels are defined so that if RAVE_INFO debug level is turned on, all higher levels will also be printed except RAVE_SILENT which means turn of logging.

Enumerator
RAVE_SPEWDEBUG 

The most verbose printouts is turned on here.

Like entering functions and similar

RAVE_DEBUG 

Basic debug functions.

RAVE_DEPRECATED 

Print outs deprecated warnings.

RAVE_INFO 

Informational messages.

RAVE_WARNING 

Warnings.

RAVE_ERROR 

Errors can be when memory not could be allocated or a file not could be created.

RAVE_CRITICAL 

If this occurs, then something has gone very wrong or the code contains a bug, please report it to the HLHDF dev group for investigation.

RAVE_SILENT 

Turns of debugging.

Function Documentation

◆ Rave_getDebugFunction()

rave_dbgfun Rave_getDebugFunction ( void )
Returns
the currently set debugger function

◆ Rave_getDebugLevel()

Rave_Debug Rave_getDebugLevel ( void )
Returns
the current rave debug level

◆ Rave_initializeDebugger()

void Rave_initializeDebugger ( void )

Initializes the debugger structure, must have been called before executing the code.

◆ Rave_printf()

void Rave_printf ( const char * fmt,
... )

The printer function.

Parameters
[in]fmt- the varargs formatter string
[in]...- the varargs list

◆ Rave_setDebugFunction()

void Rave_setDebugFunction ( rave_dbgfun dbgfun)

Sets the debug function where the debug printouts should be routed.

Parameters
[in]rave_dbgfunThe debug function.

◆ Rave_setDebugLevel()

void Rave_setDebugLevel ( Rave_Debug lvl)

Sets the debug level.

Parameters
[in]lvlthe debug level. See Rave_Debug.