Vuo  2.0.2
Classes | Macros | Functions | Variables
VuoLog.cc File Reference

Description

VuoLog implementation.

Definition in file VuoLog.cc.

Go to the source code of this file.

Classes

struct  VuoCrashReport_infoType
 Data to be inserted into macOS crash reports. More...
 

Macros

#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES   0
 Avoid conflict between Cocoa and LLVM headers. More...
 
#define VuoCrashReport_alignment   __attribute__((aligned(8)))
 Align on 8-byte boundaries. More...
 

Functions

void VuoTerminateHandler ()
 Log the timestamp at which std::terminate was called, so we can tell whether the logged exceptions are related to it. More...
 
double VuoLogGetTime (void)
 Returns the number of seconds (including fractional seconds) since an arbitrary start time. More...
 
static void __attribute__ ((constructor)) VuoLog_init(void)
 Stores the time at which this module was loaded, for use by VuoLogGetElapsedTime(). More...
 
void VuoLog_recordTime (const char *name, double time)
 Adds time to the specified profile name. More...
 
void __attribute__ ((destructor)) VuoLog_dumpProfile(void)
 Outputs all time profiles. More...
 
double VuoLogGetElapsedTime (void)
 Returns the number of seconds (including fractional seconds) since this module was loaded. More...
 
VuoCrashReport_infoType VuoCrashReport __attribute__ ((section("__DATA,__crash_info")))
 Data to be inserted into macOS crash reports. More...
 
void VuoLog_statusF (const char *file, const unsigned int linenumber, const char *function, const char *format,...)
 Helper for VuoLog_status. More...
 
int VuoLog_getOSVersionMinor (void)
 Returns the minor component of the OS version. More...
 
void VuoLog (const char *file, const unsigned int linenumber, const char *function, const char *format,...)
 Outputs a message to the system log and to stderr. More...
 
bool VuoIsDebugEnabled (void)
 Returns true if debug mode is enabled. More...
 
void VuoLog_backtrace (void)
 Prints the stack backtrace to stderr. More...
 
void VuoLog_replaceString (char *wholeString, const char *substringToRemove, const char *replacement)
 Removes all occurrences of a substring. More...
 
vector< string > VuoLog_getBacktrace (void)
 Returns the stack backtrace. More...
 

Variables

static std::terminate_handler nextTerminateHandler = nullptr
 The existing std::terminate handler before we installed ours. More...
 
double VuoLogStartTime
 The time when this module was loaded. More...
 
const int VuoLogHistoryItems = 20
 How many VLog messages to include in crash reports. More...
 
char * VuoLogHistory [VuoLogHistoryItems]
 VLog messages to include in crash reports. More...
 
dispatch_queue_t VuoLogHistoryQueue
 Serializes access to VuoLogHistory. More...
 

Class Documentation

◆ VuoCrashReport_infoType

struct VuoCrashReport_infoType
Class Members
unsigned int version VuoCrashReport_alignment
char *message VuoCrashReport_alignment Shows up in the crash report's "Application Specific Information" section.
char *signature VuoCrashReport_alignment
char *backtrace VuoCrashReport_alignment
char *message2 VuoCrashReport_alignment Shows up in the crash report's "Application Specific Information" section, above message.
void *reserved VuoCrashReport_alignment
void *reserved2 VuoCrashReport_alignment

Macro Definition Documentation

◆ __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES

#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES   0

Avoid conflict between Cocoa and LLVM headers.

Definition at line 25 of file VuoLog.cc.

◆ VuoCrashReport_alignment

#define VuoCrashReport_alignment   __attribute__((aligned(8)))

Align on 8-byte boundaries.

Definition at line 189 of file VuoLog.cc.

Function Documentation

◆ __attribute__() [1/3]

static void __attribute__ ( (constructor)  )
static

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

Installs our C++ exception handler.

Definition at line 126 of file VuoLog.cc.

◆ __attribute__() [2/3]

void __attribute__ ( (destructor)  )

Outputs all time profiles.

Definition at line 163 of file VuoLog.cc.

◆ __attribute__() [3/3]

VuoCrashReport_infoType VuoCrashReport __attribute__ ( (section("__DATA,__crash_info"))  )

Data to be inserted into macOS crash reports.

◆ VuoLog_getBacktrace()

vector<string> VuoLog_getBacktrace ( void  )

Returns the stack backtrace.

Definition at line 514 of file VuoLog.cc.

◆ VuoLog_getOSVersionMinor()

int VuoLog_getOSVersionMinor ( void  )

Returns the minor component of the OS version.

Definition at line 239 of file VuoLog.cc.

◆ VuoLog_replaceString()

void VuoLog_replaceString ( char *  wholeString,
const char *  substringToRemove,
const char *  replacement 
)

Removes all occurrences of a substring.

replacement must be shorter than the expanded substringToRemove.

Definition at line 496 of file VuoLog.cc.

◆ VuoTerminateHandler()

void VuoTerminateHandler ( )

Log the timestamp at which std::terminate was called, so we can tell whether the logged exceptions are related to it.

Definition at line 48 of file VuoLog.cc.

Variable Documentation

◆ nextTerminateHandler

std::terminate_handler nextTerminateHandler = nullptr
static

The existing std::terminate handler before we installed ours.

Definition at line 42 of file VuoLog.cc.

◆ VuoLogHistory

char* VuoLogHistory[VuoLogHistoryItems]

VLog messages to include in crash reports.

Definition at line 102 of file VuoLog.cc.

◆ VuoLogHistoryItems

const int VuoLogHistoryItems = 20

How many VLog messages to include in crash reports.

Definition at line 101 of file VuoLog.cc.

◆ VuoLogHistoryQueue

dispatch_queue_t VuoLogHistoryQueue

Serializes access to VuoLogHistory.

Definition at line 103 of file VuoLog.cc.

◆ VuoLogStartTime

double VuoLogStartTime

The time when this module was loaded.

Definition at line 99 of file VuoLog.cc.