Vuo  0.7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables

Description

Macros to help with debugging.

Macros

#define VL()   fprintf(stderr, "\033[38;5;%dm# pid=%d t=%8.4fs %s:%d\t%s()\033[0m\n", getpid()%212+19, getpid(), VLogGetElapsedTime(), __FILE__, __LINE__, __func__);
 Prints the name of the file and function to stderr (and implicitly flushes the output buffer).
 
#define VLog(format,...)   fprintf(stderr, "\033[38;5;%dm# pid=%d t=%8.4fs %s:%d\t%s() \t" format "\033[0m\n", getpid()%212+19, getpid(), VLogGetElapsedTime(), __FILE__, __LINE__, __func__, ##__VA_ARGS__);
 Prints the name of the file and function, and printf()-style format/arguments, to stderr (and implicitly flushes the output buffer).
 
#define VLogHeap(heapPointer)   VLog("%s = %p (registered at %s)", #heapPointer, heapPointer, VuoHeap_getDescription(heapPointer));
 Prints the name of the current file and function, and the address and description of the specified heapPointer, to stderr (and implicitly flushes the output buffer).
 
#define VLogCF(coreFoundationRef)   { CFStringRef d = CFCopyDescription(coreFoundationRef); CFIndex len = CFStringGetLength(d)+1; char *z = (char *)malloc(len); CFStringGetCString(d, z, len, kCFStringEncodingUTF8); VLog("%s = %s", #coreFoundationRef, z); free(z); CFRelease(d); }
 Prints the specified Core Foundation object.
 

Functions

static double VLogGetTime (void)
 Returns the number of seconds (including fractional seconds) since midnight 1970.01.01 GMT.
 
static void __attribute__ ((constructor)) VLogInitTime(void)
 Stores the time at which this module was loaded, for use by VLogGetElapsedTime().
 
static double VLogGetElapsedTime ()
 Returns the number of seconds (including fractional seconds) since this module was loaded.
 

Variables

static double VLogStartTime
 The time when this module was loaded.
 

Macro Definition Documentation

#define VL ( )    fprintf(stderr, "\033[38;5;%dm# pid=%d t=%8.4fs %s:%d\t%s()\033[0m\n", getpid()%212+19, getpid(), VLogGetElapsedTime(), __FILE__, __LINE__, __func__);

Prints the name of the file and function to stderr (and implicitly flushes the output buffer).

Useful for debugging.

Example:
void nodeEvent()
{
VL();
}
#define VLog (   format,
  ... 
)    fprintf(stderr, "\033[38;5;%dm# pid=%d t=%8.4fs %s:%d\t%s() \t" format "\033[0m\n", getpid()%212+19, getpid(), VLogGetElapsedTime(), __FILE__, __LINE__, __func__, ##__VA_ARGS__);

Prints the name of the file and function, and printf()-style format/arguments, to stderr (and implicitly flushes the output buffer).

Useful for debugging.

Example:
void nodeEvent(VuoInputData(VuoInteger, "42") number)
{
VLog("%d", number);
}
#define VLogCF (   coreFoundationRef)    { CFStringRef d = CFCopyDescription(coreFoundationRef); CFIndex len = CFStringGetLength(d)+1; char *z = (char *)malloc(len); CFStringGetCString(d, z, len, kCFStringEncodingUTF8); VLog("%s = %s", #coreFoundationRef, z); free(z); CFRelease(d); }

Prints the specified Core Foundation object.

#define VLogHeap (   heapPointer)    VLog("%s = %p (registered at %s)", #heapPointer, heapPointer, VuoHeap_getDescription(heapPointer));

Prints the name of the current file and function, and the address and description of the specified heapPointer, to stderr (and implicitly flushes the output buffer).

Useful for debugging.

Example:
{
VLogHeap(shader);
}

Function Documentation

static void __attribute__ ( (constructor)  )
static

Stores the time at which this module was loaded, for use by VLogGetElapsedTime().

static double VLogGetElapsedTime ( )
static

Returns the number of seconds (including fractional seconds) since this module was loaded.

static double VLogGetTime ( void  )
static

Returns the number of seconds (including fractional seconds) since midnight 1970.01.01 GMT.

Variable Documentation

double VLogStartTime
static

The time when this module was loaded.