]> git.imager.perl.org - imager.git/blob - log.h
merge in tiff re-work branch
[imager.git] / log.h
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
13 void i_lhead ( const char *file, int line  );
14 void i_init_log( const char *name, int onoff );
15 void i_loog(int level,const char *msg, ... );
16 void i_fatal ( int exitcode,const char *fmt, ... );
17
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 */
30
31 #ifdef IMAGER_LOG
32 #define mm_log(x) { i_lhead(__FILE__,__LINE__); i_loog x; } 
33 #else
34 #define mm_log(x)
35 #endif
36
37
38 #endif /* _LOG_H_ */