LAL  7.5.0.1-b72065a
Header LogPrintf.h

Detailed Description

General-purpose log-message handling, mostly modelled after the MSG_LOG class in BOINC.

Author
Reinhard Prix
Date
2005

Prototypes

LogLevel_t LogLevel (void)
 Get log level by examining lalDebugLevel. More...
 
void LogSetFile (FILE *fp)
 Set file to print log messages to. More...
 
void LogPrintf (LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
 
void void LogPrintfVerbatim (LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
 
void void int XLALfprintfGSLmatrix (FILE *fp, const char *fmt, const gsl_matrix *gij) _LAL_GCC_VPRINTF_FORMAT_(2)
 Output gsl_matrix in octave-format, using the given format for the matrix-entries return -1 on error, 0 if OK. More...
 
int XLALfprintfGSLvector (FILE *fp, const char *fmt, const gsl_vector *vect) _LAL_GCC_VPRINTF_FORMAT_(2)
 Output gsl_matrix in octave-format, using the given format for the matrix-entries return -1 on error, 0 if OK. More...
 
int XLALfprintfGSLvector_int (FILE *fp, const char *fmt, const gsl_vector_int *vect) _LAL_GCC_VPRINTF_FORMAT_(2)
 
REAL8 XLALGetTimeOfDay (void)
 Return time of day (seconds since 1970) as a double. More...
 
REAL8 XLALGetCPUTime (void)
 High-resolution CPU timer (returns result in seconds), aimed for code-timing purposes. More...
 
const char * LogGetTimestamp (void)
 
REAL8 XLALGetPeakHeapUsageMB (void)
 Returns the peak amount of memory (in MB) allocated on the heap so far using either lalMallocTotalPeak if memory-debugging is active or getrusage (if available), otherwise returns -1 (without error) for "dont know". More...
 
char * XLALClearLinebreaks (const char *str)
 Returns input string with line-breaks '
' removed (replaced by space) The original string is unmodified. More...
 
int XLALdumpREAL4TimeSeries (const char *fname, const REAL4TimeSeries *series)
 dump given REAL4 time-series into a text-file More...
 
int XLALdumpREAL8TimeSeries (const char *fname, const REAL8TimeSeries *series)
 dump given REAL8 time-series into a text-file More...
 
int XLALdumpCOMPLEX8TimeSeries (const char *fname, const COMPLEX8TimeSeries *series)
 dump given COMPLEX8 time-series into a text-file More...
 

Enumerations

enum  LogLevel_t {
  LOG_NONE = 0 , LOG_CRITICAL , LOG_NORMAL , LOG_DEBUG ,
  LOG_DETAIL , LOG_LAST
}
 Argument-type for LogPrintf(): determines log-level of this message. More...
 

Function Documentation

◆ LogLevel()

LogLevel_t LogLevel ( void  )

Get log level by examining lalDebugLevel.

Definition at line 85 of file LogPrintf.c.

◆ LogSetFile()

void LogSetFile ( FILE *  fp)

Set file to print log messages to.

Definition at line 97 of file LogPrintf.c.

◆ LogPrintf()

void LogPrintf ( LogLevel_t  ,
const char *  format,
  ... 
)

◆ LogPrintfVerbatim()

void void LogPrintfVerbatim ( LogLevel_t  ,
const char *  format,
  ... 
)

◆ XLALfprintfGSLmatrix()

void void int XLALfprintfGSLmatrix ( FILE *  fp,
const char *  fmt,
const gsl_matrix *  gij 
)

Output gsl_matrix in octave-format, using the given format for the matrix-entries return -1 on error, 0 if OK.

Definition at line 332 of file LogPrintf.c.

◆ XLALfprintfGSLvector()

int XLALfprintfGSLvector ( FILE *  fp,
const char *  fmt,
const gsl_vector *  vect 
)

Output gsl_matrix in octave-format, using the given format for the matrix-entries return -1 on error, 0 if OK.

Definition at line 374 of file LogPrintf.c.

◆ XLALfprintfGSLvector_int()

int XLALfprintfGSLvector_int ( FILE *  fp,
const char *  fmt,
const gsl_vector_int *  vect 
)

Definition at line 400 of file LogPrintf.c.

◆ XLALGetTimeOfDay()

REAL8 XLALGetTimeOfDay ( void  )

Return time of day (seconds since 1970) as a double.

Taken from BOINC's dtime():

Definition at line 229 of file LogPrintf.c.

◆ XLALGetCPUTime()

REAL8 XLALGetCPUTime ( void  )

High-resolution CPU timer (returns result in seconds), aimed for code-timing purposes.

Attempts to provide the highest time resolution available, while adding as little overhead as possible.

Note
Returns 0.0 if no CPU timer is available.

Definition at line 270 of file LogPrintf.c.

◆ LogGetTimestamp()

const char* LogGetTimestamp ( void  )

Definition at line 290 of file LogPrintf.c.

◆ XLALGetPeakHeapUsageMB()

REAL8 XLALGetPeakHeapUsageMB ( void  )

Returns the peak amount of memory (in MB) allocated on the heap so far using either lalMallocTotalPeak if memory-debugging is active or getrusage (if available), otherwise returns -1 (without error) for "dont know".

Note
the reported number always refers to the 'nominal' memory usage not including any extra "padding" that would have been added by LALMalloc(), which typically doubles memory usage.

Definition at line 192 of file LogPrintf.c.

◆ XLALClearLinebreaks()

char* XLALClearLinebreaks ( const char *  str)

Returns input string with line-breaks '
' removed (replaced by space) The original string is unmodified.

The returned string is allocated here.

Definition at line 431 of file LogPrintf.c.

◆ XLALdumpREAL4TimeSeries()

int XLALdumpREAL4TimeSeries ( const char *  fname,
const REAL4TimeSeries series 
)

dump given REAL4 time-series into a text-file

Definition at line 456 of file LogPrintf.c.

◆ XLALdumpREAL8TimeSeries()

int XLALdumpREAL8TimeSeries ( const char *  fname,
const REAL8TimeSeries series 
)

dump given REAL8 time-series into a text-file

Definition at line 482 of file LogPrintf.c.

◆ XLALdumpCOMPLEX8TimeSeries()

int XLALdumpCOMPLEX8TimeSeries ( const char *  fname,
const COMPLEX8TimeSeries series 
)

dump given COMPLEX8 time-series into a text-file

Definition at line 509 of file LogPrintf.c.

Enumeration Type Documentation

◆ LogLevel_t

enum LogLevel_t

Argument-type for LogPrintf(): determines log-level of this message.

Enumerator
LOG_NONE 

internal: don't use

LOG_CRITICAL 

log-level for critical errors

LOG_NORMAL 

'normal' log-level

LOG_DEBUG 

debug log-level

LOG_DETAIL 

detailed log-level

LOG_LAST 

internal: don't use

Definition at line 52 of file LogPrintf.h.