Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-00ddc7f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LogPrintf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 Karl Wette
3 * Copyright (C) 2005 Reinhard Prix
4 *
5 * [partially based on the MSG_LOG class in BOINC:
6 * Copyright (C) 2005 University of California]
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with with program; see the file COPYING. If not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 * MA 02110-1301 USA
22 */
23
24#ifndef _LOGPRINTF_H /* Double-include protection. */
25#define _LOGPRINTF_H
26
27/* C++ protection. */
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/*---------- INCLUDES ----------*/
33#include <stdarg.h>
34#include <gsl/gsl_matrix.h>
35
36#include <lal/LALDatatypes.h>
37
38/**
39 * \defgroup LogPrintf_h Header LogPrintf.h
40 * \ingroup lal_support
41 * \author Reinhard Prix
42 * \date 2005
43 * \brief General-purpose log-message handling, mostly modelled after the MSG_LOG class in BOINC.
44 *
45 */
46/** @{ */
47
48/*---------- DEFINES ----------*/
49/*---------- TYPES ----------*/
50
51/** Argument-type for LogPrintf(): determines log-level of this message */
52typedef enum tagLogLevel_t
53 {
54 LOG_NONE = 0, /**< internal: don't use */
55 LOG_CRITICAL, /**< log-level for critical errors */
56 LOG_NORMAL, /**< 'normal' log-level */
57 LOG_DEBUG, /**< debug log-level */
58 LOG_DETAIL, /**< detailed log-level */
59 LOG_LAST /**< internal: don't use */
61
62/*---------- GLOBALs ----------*/
63
64/*---------- PROTOTYPES [API] ----------*/
66
67void LogSetFile( FILE* fp );
68
69void LogPrintf (LogLevel_t, const char* format, ...) _LAL_GCC_PRINTF_FORMAT_(2,3);
70void LogPrintfVerbatim (LogLevel_t, const char* format, ...) _LAL_GCC_PRINTF_FORMAT_(2,3);
71
72int XLALfprintfGSLmatrix ( FILE *fp, const char *fmt, const gsl_matrix *gij ) _LAL_GCC_VPRINTF_FORMAT_(2);
73int XLALfprintfGSLvector ( FILE *fp, const char *fmt, const gsl_vector *vect ) _LAL_GCC_VPRINTF_FORMAT_(2);
74int XLALfprintfGSLvector_int ( FILE *fp, const char *fmt, const gsl_vector_int *vect ) _LAL_GCC_VPRINTF_FORMAT_(2);
75
77REAL8 XLALGetCPUTime ( void );
78const char * LogGetTimestamp (void);
79
81
82char * XLALClearLinebreaks ( const char *str );
83
84
85int XLALdumpREAL4TimeSeries (const char *fname, const REAL4TimeSeries *series);
86int XLALdumpREAL8TimeSeries (const char *fname, const REAL8TimeSeries *series);
87int XLALdumpCOMPLEX8TimeSeries (const char *fname, const COMPLEX8TimeSeries *series );
88
89/** @} */
90
91#ifdef __cplusplus
92}
93#endif
94/* C++ protection. */
95
96#endif /* Double-include protection. */
#define _LAL_GCC_VPRINTF_FORMAT_(NFMT)
Definition: LALStddef.h:48
#define _LAL_GCC_PRINTF_FORMAT_(NFMT, NARG)
Definition: LALStddef.h:47
double REAL8
Double precision real floating-point number (8 bytes).
void LogSetFile(FILE *fp)
Set file to print log messages to.
Definition: LogPrintf.c:97
int XLALdumpREAL8TimeSeries(const char *fname, const REAL8TimeSeries *series)
dump given REAL8 time-series into a text-file
Definition: LogPrintf.c:482
REAL8 XLALGetCPUTime(void)
High-resolution CPU timer (returns result in seconds), aimed for code-timing purposes.
Definition: LogPrintf.c:270
int XLALdumpREAL4TimeSeries(const char *fname, const REAL4TimeSeries *series)
dump given REAL4 time-series into a text-file
Definition: LogPrintf.c:456
REAL8 XLALGetPeakHeapUsageMB(void)
Returns the peak amount of memory (in MB) allocated on the heap so far using either lalMallocTotalPea...
Definition: LogPrintf.c:192
LogLevel_t
Argument-type for LogPrintf(): determines log-level of this message.
Definition: LogPrintf.h:53
char * XLALClearLinebreaks(const char *str)
Returns input string with line-breaks ' ' removed (replaced by space) The original string is unmodifi...
Definition: LogPrintf.c:431
const char * LogGetTimestamp(void)
Definition: LogPrintf.c:290
int XLALdumpCOMPLEX8TimeSeries(const char *fname, const COMPLEX8TimeSeries *series)
dump given COMPLEX8 time-series into a text-file
Definition: LogPrintf.c:509
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,...
Definition: LogPrintf.c:332
int XLALfprintfGSLvector_int(FILE *fp, const char *fmt, const gsl_vector_int *vect) _LAL_GCC_VPRINTF_FORMAT_(2)
Definition: LogPrintf.c:400
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,...
Definition: LogPrintf.c:374
void void LogPrintfVerbatim(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
REAL8 XLALGetTimeOfDay(void)
Return time of day (seconds since 1970) as a double.
Definition: LogPrintf.c:229
LogLevel_t LogLevel(void)
Get log level by examining lalDebugLevel.
Definition: LogPrintf.c:85
void LogPrintf(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
@ LOG_CRITICAL
log-level for critical errors
Definition: LogPrintf.h:55
@ LOG_LAST
internal: don't use
Definition: LogPrintf.h:59
@ LOG_NONE
internal: don't use
Definition: LogPrintf.h:54
@ LOG_DEBUG
debug log-level
Definition: LogPrintf.h:57
@ LOG_NORMAL
'normal' log-level
Definition: LogPrintf.h:56
@ LOG_DETAIL
detailed log-level
Definition: LogPrintf.h:58
Time series of COMPLEX8 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:590
Time series of REAL4 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:570
Time series of REAL8 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:580
FILE * fp
Definition: tconvert.c:105