File: exx_log.h

package info (click to toggle)
openmx 3.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 325,856 kB
  • ctags: 3,575
  • sloc: ansic: 152,655; f90: 2,080; python: 876; makefile: 675; sh: 25; perl: 18
file content (63 lines) | stat: -rw-r--r-- 1,981 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*----------------------------------------------------------------------
  exx_log.h

  simple logging tool

  Coded by M. Toyoda, 16 Dec. 2009 
----------------------------------------------------------------------*/
#ifndef EXX_LOG_H_INCLUDED
#define EXX_LOG_H_INCLUDED

#define EXX_LOG_SWITCH 1

/* works only for root process */
void EXX_Log_StdOut(const char *fmt, ... );
void EXX_Log_StdErr(const char *fmt, ... );


#define EXX_ERROR( msg ) EXX_Error( msg, __FILE__, __LINE__ )
#define EXX_WARN( msg )  EXX_Warn( msg, __FILE__, __LINE__ )

void EXX_Error(const char *msg, const char *file, int line);
void EXX_Warn(const char *msg, const char *file, int line);


#if EXX_LOG_SWITCH

void EXX_Log_Open(void);
void EXX_Log_Close(void);

void EXX_Log_Print(const char *fmt, ... );

void EXX_Log_Message(const char *message);
void EXX_Log_Trace_Integer(const char *key, int val);
void EXX_Log_Trace_Double(const char *key, double val);
void EXX_Log_Trace_String(const char *key, const char *val);
void EXX_Log_Trace_Vector(const char *ket, const double *val);

#define EXX_LOG_OPEN               EXX_Log_Open()
#define EXX_LOG_CLOSE              EXX_Log_Close()
#define EXX_LOG_MESSAGE( message ) EXX_Log_Message( message )
#define EXX_LOG_TRACE_INTEGER( key , val ) EXX_Log_Trace_Integer( key, val )
#define EXX_LOG_TRACE_DOUBLE( key , val )  EXX_Log_Trace_Double( key, val )
#define EXX_LOG_TRACE_STRING( key , val )  EXX_Log_Trace_String( key, val )
#define EXX_LOG_TRACE_VECTOR( key , val )  EXX_Log_Trace_Vector( key, val )

#if __STDC_VERSION__ >= 199901L
#define EXX_LOG_PRINT( fmt , ... ) EXX_Log_Print( fmt, __VA_ARGS__ )
#endif

#else

#define EXX_LOG_OPEN
#define EXX_LOG_OPEN
#define EXX_LOG_CLOSE
#define EXX_LOG_MESSAGE( message ) 
#define EXX_LOG_TRACE_INTEGER( key , val )
#define EXX_LOG_TRACE_DOUBLE( key , val ) 
#define EXX_LOG_TRACE_STRING( key , val )
#define EXX_LOG_TRACE_VECTOR( key , val )

#endif /* EXX_LOG_SWITCH */

#endif /* EXX_LOG_H_INCLUDED */