General-purpose log-message handling, mostly modelled after the MSG_LOG class in BOINC.
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... | |
| LogLevel_t LogLevel | ( | void | ) |
Get log level by examining lalDebugLevel.
Definition at line 85 of file LogPrintf.c.
| void LogSetFile | ( | FILE * | fp | ) |
Set file to print log messages to.
Definition at line 97 of file LogPrintf.c.
| void LogPrintf | ( | LogLevel_t | , |
| const char * | format, | ||
| ... | |||
| ) |
| void void LogPrintfVerbatim | ( | LogLevel_t | , |
| const char * | format, | ||
| ... | |||
| ) |
| 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.
| 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.
| int XLALfprintfGSLvector_int | ( | FILE * | fp, |
| const char * | fmt, | ||
| const gsl_vector_int * | vect | ||
| ) |
Definition at line 400 of file LogPrintf.c.
| 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.
| 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.
Definition at line 270 of file LogPrintf.c.
| const char * LogGetTimestamp | ( | void | ) |
Definition at line 290 of file LogPrintf.c.
| 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".
Definition at line 192 of file LogPrintf.c.
| 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.
| 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.
| 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.
| 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.
| 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.