LAL  7.5.0.1-b72065a
LogPrintf.c File Reference

Prototypes

static FILE * LogFile (void)
 Decide where to print log messages. More...
 
static const char * LogTimeToString (double t)
 
static const char * LogFormatLevel (LogLevel_t level)
 
LogLevel_t LogLevel (void)
 Get log level by examining lalDebugLevel. More...
 
void LogSetFile (FILE *fp)
 Set file to print log messages to. More...
 
void LogPrintfVerbatim (LogLevel_t level, const char *format,...)
 Verbatim output of the given log-message if LogLevel() >= level. More...
 
void LogPrintf (LogLevel_t level, const char *format,...)
 Output the given log-message, prefixed by a timestamp and level, if LogLevel() >= level. More...
 
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...
 
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)
 
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. More...
 
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. More...
 
int XLALfprintfGSLvector_int (FILE *fp, const char *fmt, const gsl_vector_int *vect)
 
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...
 

Go to the source code of this file.

Macros

#define localtime_r(timep, result)   memcpy((result), localtime(timep), sizeof(struct tm))
 

Variables

static FILE * logFile = NULL
 

Macro Definition Documentation

◆ localtime_r

#define localtime_r (   timep,
  result 
)    memcpy((result), localtime(timep), sizeof(struct tm))

Definition at line 61 of file LogPrintf.c.

Function Documentation

◆ LogFile()

static FILE * LogFile ( void  )
static

Decide where to print log messages.

Definition at line 103 of file LogPrintf.c.

◆ LogTimeToString()

const char * LogTimeToString ( double  t)
static

Definition at line 159 of file LogPrintf.c.

◆ LogFormatLevel()

static const char * LogFormatLevel ( LogLevel_t  level)
static

Definition at line 298 of file LogPrintf.c.

◆ LogPrintfVerbatim()

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

Verbatim output of the given log-message if LogLevel() >= level.

Definition at line 116 of file LogPrintf.c.

◆ LogPrintf()

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

Output the given log-message, prefixed by a timestamp and level, if LogLevel() >= level.

Definition at line 138 of file LogPrintf.c.

Variable Documentation

◆ logFile

FILE* logFile = NULL
static

Definition at line 71 of file LogPrintf.c.