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