Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Macros | Functions

Files

file  afw_debug.h
 Adaptive Framework Software Debug Header.
 

Macros

#define AFW_DEBUG_STATIC_DEBUG_ID(label, debug_id)
 Define a static debug_id rti. More...
 
#define afw_debug(flag_index, instance, message, xctx)
 If applicable, write debug. More...
 
#define afw_debug_fz(flag_index, instance, xctx, format_z, ...)
 If applicable, write debug using a printf style format. More...
 
#define afw_debug_vz(flag_index, instance, format_z, ap, xctx)
 If applicable, write debug using a printf style format and va_list. More...
 
#define afw_debug_z(flag_index, instance, message_z, xctx)
 If applicable, write debug from zero terminate string. More...
 

Functions

void afw_debug_write (const afw_interface_implementation_rti_t *rti, const afw_utf8_z_t *source_z, const afw_utf8_t *message, afw_xctx_t *xctx)
 Write debug. More...
 
void afw_debug_write_fz (const afw_interface_implementation_rti_t *rti, const afw_utf8_z_t *source_z, afw_xctx_t *xctx, const afw_utf8_z_t *format_z,...)
 Write debug using a printf style format. More...
 
void afw_debug_write_vz (const afw_interface_implementation_rti_t *rti, const afw_utf8_z_t *source_z, const afw_utf8_z_t *format_z, va_list ap, afw_xctx_t *xctx)
 Write debug using a printf style format and va_list. More...
 
void afw_debug_write_z (const afw_interface_implementation_rti_t *rti, const afw_utf8_z_t *source_z, const afw_utf8_z_t *message_z, afw_xctx_t *xctx)
 Write debug from zero terminate string. More...
 

Detailed Description

These macros and functions assist writing debug message to the environment log. All debug message have associated runtime information (rti) that can be used for prefixing messages as well as filtering. The first parameter of macros AFW_DEBUG(), AFW_DEBUG_Z(), AFW_DEBUG_FZ(), and AFW_DEBUG_VZ() is a instance, which is used to locate the implementation rti. The AFW_DEBUG_WRITE*() macros and afw_debug_write*() functions have rti as the first parameter.

All debug message are written to the environment log. See afw_log.h for more information.

Macro Definition Documentation

◆ afw_debug

#define afw_debug (   flag_index,
  instance,
  message,
  xctx 
)
Value:
if ((flag_index) < (xctx)->flags_count && (xctx)->flags[flag_index]) \
afw_debug_write( \
((instance) ? \
&((const afw_instance_t *)instance)->inf->rti \
: NULL), \
AFW__FILE_LINE__, message, xctx)
#define AFW__FILE_LINE__
file:line
Definition: afw_common.h:148
Minimal Instance.

If applicable, write debug.

Parameters
flag_indexof flag to check to determine if debug is applicable.
instanceassociated with debug message.
messageto log.
xctxof caller.

Definition at line 59 of file afw_debug.h.

◆ afw_debug_fz

#define afw_debug_fz (   flag_index,
  instance,
  xctx,
  format_z,
  ... 
)
Value:
if ((flag_index) < (xctx)->flags_count && (xctx)->flags[flag_index]) \
afw_debug_write_fz( \
((instance) ? \
&((const afw_instance_t *)instance)->inf->rti \
: NULL), \
AFW__FILE_LINE__, xctx, format_z, __VA_ARGS__)

If applicable, write debug using a printf style format.

Parameters
flag_indexof flag to check to determine if debug is applicable.
instanceassociated with debug message.
xctxof caller.
format_zfor message to log.
...parameters for format.

Definition at line 76 of file afw_debug.h.

◆ AFW_DEBUG_STATIC_DEBUG_ID

#define AFW_DEBUG_STATIC_DEBUG_ID (   label,
  debug_id 
)
Value:
static const afw_interface_implementation_rti_t label = \
{"afw_debug_id", __FILE__, debug_id};
Interface Implementation Run Time Information.

Define a static debug_id rti.

Parameters
labelfor the static debug_id rti.
debug_idThe first parameter of afw_debug_write*() functions and AFW_DEBUG_WRITE*() macros is an rti. This macro defines a static rti that can be passed to these for non-interface debugging.

Definition at line 47 of file afw_debug.h.

◆ afw_debug_vz

#define afw_debug_vz (   flag_index,
  instance,
  format_z,
  ap,
  xctx 
)
Value:
if ((flag_index) < (xctx)->flags_count && (xctx)->flags[flag_index]) \
afw_debug_write_vz( \
((instance) ? \
&((const afw_instance_t *)instance)->inf->rti \
: NULL), \
AFW__FILE_LINE__, format_z, ap, xctx)

If applicable, write debug using a printf style format and va_list.

Parameters
flag_indexof flag to check to determine if debug is applicable.
instanceassociated with debug message.
format_zfor message to log.
apva_list for format.
xctxof caller.

Definition at line 99 of file afw_debug.h.

◆ afw_debug_z

#define afw_debug_z (   flag_index,
  instance,
  message_z,
  xctx 
)
Value:
if ((flag_index) < (xctx)->flags_count && (xctx)->flags[flag_index]) \
afw_debug_write_z( \
((instance) ? \
&((const afw_instance_t *)instance)->inf->rti \
: NULL), \
AFW__FILE_LINE__, message_z, xctx)

If applicable, write debug from zero terminate string.

Parameters
flag_indexof flag to check to determine if debug is applicable.
instanceassociated with debug message.
message_zto log.
xctxof caller.

Definition at line 115 of file afw_debug.h.

Function Documentation

◆ afw_debug_write()

void afw_debug_write ( const afw_interface_implementation_rti_t rti,
const afw_utf8_z_t source_z,
const afw_utf8_t message,
afw_xctx_t xctx 
)

Write debug.

Parameters
rtiassociated with debug message.
source_zfile:line.
messageto log.
xctxof caller.

Normally afw_debug() should be called instead.

Definition at line 21 of file afw_debug.c.

◆ afw_debug_write_fz()

void afw_debug_write_fz ( const afw_interface_implementation_rti_t rti,
const afw_utf8_z_t source_z,
afw_xctx_t xctx,
const afw_utf8_z_t format_z,
  ... 
)

Write debug using a printf style format.

Parameters
rtiassociated with debug message.
source_zfile:line.
xctxof caller.
format_zfor message to log.
...parameters for format.

Normally afw_debug_fz() should be called instead.

Definition at line 46 of file afw_debug.c.

◆ afw_debug_write_vz()

void afw_debug_write_vz ( const afw_interface_implementation_rti_t rti,
const afw_utf8_z_t source_z,
const afw_utf8_z_t format_z,
va_list  ap,
afw_xctx_t xctx 
)

Write debug using a printf style format and va_list.

Parameters
rtiassociated with debug message.
source_zfile:line.
format_zfor message to log.
apva_list for format.
xctxof caller.

Normally afw_debug_vz() should be called instead.

Definition at line 66 of file afw_debug.c.

◆ afw_debug_write_z()

void afw_debug_write_z ( const afw_interface_implementation_rti_t rti,
const afw_utf8_z_t source_z,
const afw_utf8_z_t message_z,
afw_xctx_t xctx 
)

Write debug from zero terminate string.

Parameters
rtiassociated with debug message.
source_zfile:line.
message_zto log.
xctxof caller.

Normally afw_debug_z() should be called instead.

Definition at line 81 of file afw_debug.c.