Vuo  2.4.0
Macros | Functions | Variables

Description

Macros to help with debugging.

Macros

#define VuoLog_status(format, ...)
 Stores status information so it can be included in crash reports. More...
 
#define VL()
 Prints the name of the file and function to the system log and to stderr (and implicitly flushes the output buffer). More...
 
#define VLog(format, ...)
 Prints the name of the file and function, and printf()-style format/arguments, to the system log and to stderr (and implicitly flushes the output buffer). More...
 
#define VUserLog(format, ...)
 Same as VLog, but for messages intended for end users. More...
 
#define VDebugLog(format, ...)
 Same as VLog, but for debug messages intended for end users. More...
 
#define VLogHeap(heapPointer)
 Prints the name of the current file and function, and the address and description of the specified heapPointer, to the system log and to stderr (and implicitly flushes the output buffer). More...
 
#define VUOLOG_PROFILE_BEGIN(object)
 Starts a profiler time sample. More...
 
#define VUOLOG_PROFILE_END(object)
 Ends a profiler time sample. More...
 

Functions

double VuoLogGetTime (void)
 Returns the number of seconds (including fractional seconds) since an arbitrary start time. More...
 
double VuoLogGetElapsedTime (void)
 Returns the number of seconds (including fractional seconds) since this module was loaded. More...
 
bool VuoIsDebugEnabled (void)
 Returns true if debug mode is enabled. More...
 
void VuoLog_backtrace (void)
 Prints the stack backtrace to stderr. More...
 
bool VuoLog_isDebuggerAttached (void)
 Returns true if the current process is being debugged (either launched by LLDB/Instruments, or the LLDB/Instruments attached after the process launched). More...
 
void VuoLog_statusF (const char *moduleName, const char *file, const unsigned int linenumber, const char *function, const char *format,...)
 Helper for VuoLog_status. More...
 
void VuoLog (const char *moduleName, const char *file, const unsigned int linenumber, const char *function, const char *format,...)
 Outputs a message to the system log and to stderr. More...
 
void VuoLog_recordTime (const char *name, double time)
 Adds time to the specified profile name. More...
 

Variables

static char * VuoLog_moduleName = 0
 The name of the current dylib (as opposed to the process's main executable), set by VuoLog_initModuleName. More...
 

Macro Definition Documentation

◆ VDebugLog

#define VDebugLog (   format,
  ... 
)

Same as VLog, but for debug messages intended for end users.

Definition at line 147 of file VuoLog.h.

◆ VL

#define VL ( )

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

Example:
void nodeEvent()
{
VL();
}

Definition at line 117 of file VuoLog.h.

◆ VLog

#define VLog (   format,
  ... 
)

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

Use this for debugging only; don't commit files with VLog calls. To log messages intended for end users, see VUserLog.

Example:
void nodeEvent(VuoInputData(VuoInteger, "42") number)
{
VLog("%lld", number);
}

Definition at line 133 of file VuoLog.h.

◆ VLogHeap

#define VLogHeap (   heapPointer)

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

Example:
{
VLogHeap(shader);
}

Definition at line 161 of file VuoLog.h.

◆ VUOLOG_PROFILE_BEGIN

#define VUOLOG_PROFILE_BEGIN (   object)

Starts a profiler time sample.

In this macro's parameter, pass a text identifier for the time sample (such as the variable name of a libdispatch queue or semaphore).

Example:

Definition at line 185 of file VuoLog.h.

◆ VUOLOG_PROFILE_END

#define VUOLOG_PROFILE_END (   object)

Ends a profiler time sample.

Definition at line 190 of file VuoLog.h.

◆ VuoLog_status

#define VuoLog_status (   format,
  ... 
)

Stores status information so it can be included in crash reports.

Only the most recent status is stored. Use NULL to clear the status.

Similar to VUserLog()/VDebugLog(), but useful for highly verbose status messages where only the most recent is relevant.

Definition at line 83 of file VuoLog.h.

◆ VUserLog

#define VUserLog (   format,
  ... 
)

Same as VLog, but for messages intended for end users.

Definition at line 140 of file VuoLog.h.

Function Documentation

◆ VuoIsDebugEnabled()

bool VuoIsDebugEnabled ( void  )

Returns true if debug mode is enabled.

Users can enable debug mode by executing defaults write org.vuo.Editor debug -boolean true, and can disable it by executing defaults delete org.vuo.Editor debug.

Nodes should use this to control verbose logging.

Definition at line 594 of file VuoLog.cc.

◆ VuoLog()

void VuoLog ( const char *  moduleName,
const char *  file,
const unsigned int  linenumber,
const char *  function,
const char *  format,
  ... 
)

Outputs a message to the system log and to stderr.

Also stores the most recent several messages in the OS X CrashReporter data structure, to be included with crash reports.

Definition at line 308 of file VuoLog.cc.

◆ VuoLog_backtrace()

void VuoLog_backtrace ( void  )

Prints the stack backtrace to stderr.

Definition at line 607 of file VuoLog.cc.

◆ VuoLog_isDebuggerAttached()

bool VuoLog_isDebuggerAttached ( void  )

Returns true if the current process is being debugged (either launched by LLDB/Instruments, or the LLDB/Instruments attached after the process launched).

Based on https://developer.apple.com/library/archive/qa/qa1361/_index.html

Definition at line 277 of file VuoLog.cc.

◆ VuoLog_recordTime()

void VuoLog_recordTime ( const char *  name,
double  time 
)

Adds time to the specified profile name.

Definition at line 150 of file VuoLog.cc.

◆ VuoLog_statusF()

void VuoLog_statusF ( const char *  moduleName,
const char *  file,
const unsigned int  linenumber,
const char *  function,
const char *  format,
  ... 
)

Helper for VuoLog_status.

Definition at line 216 of file VuoLog.cc.

◆ VuoLogGetElapsedTime()

double VuoLogGetElapsedTime ( void  )

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

Definition at line 191 of file VuoLog.cc.

◆ VuoLogGetTime()

double VuoLogGetTime ( void  )

Returns the number of seconds (including fractional seconds) since an arbitrary start time.

Definition at line 80 of file VuoLog.cc.

Variable Documentation

◆ VuoLog_moduleName

char* VuoLog_moduleName = 0
static

The name of the current dylib (as opposed to the process's main executable), set by VuoLog_initModuleName.

Definition at line 46 of file VuoLog.h.