Commit | Line | Data |
---|---|---|
02d1d628 AMH |
1 | #ifndef _LOG_H_ |
2 | #define _LOG_H_ | |
3 | ||
4 | #include <stdio.h> | |
5 | #include <stdarg.h> | |
6 | #include <time.h> | |
7 | /* | |
8 | input: name of file to log too | |
9 | input: onoff, 0 means no logging | |
10 | global: creates a global variable FILE* lg_file | |
11 | */ | |
12 | ||
10ea52a3 TC |
13 | int i_init_log( const char *name, int onoff ); |
14 | void i_fatal ( int exitcode,const char *fmt, ... ); | |
bf1573f9 | 15 | void i_lhead ( const char *file, int line ); |
bf1573f9 | 16 | void i_loog(int level,const char *msg, ... ); |
02d1d628 | 17 | |
bd8052a6 TC |
18 | /* |
19 | =item mm_log((level, format, ...)) | |
20 | =category Logging | |
21 | ||
22 | This is the main entry point to logging. Note that the extra set of | |
23 | parentheses are required due to limitations in C89 macros. | |
24 | ||
25 | This will format a string with the current file and line number to the | |
26 | log file if logging is enabled. | |
27 | ||
28 | =cut | |
29 | */ | |
02d1d628 AMH |
30 | |
31 | #ifdef IMAGER_LOG | |
bf1573f9 | 32 | #define mm_log(x) { i_lhead(__FILE__,__LINE__); i_loog x; } |
02d1d628 AMH |
33 | #else |
34 | #define mm_log(x) | |
35 | #endif | |
36 | ||
37 | ||
38 | #endif /* _LOG_H_ */ |