Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 57 lines (45 sloc) 1.554 kB
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
1 #ifndef _LOG_H_
2 #define _LOG_H_
3
4 #include <stdio.h>
5 #include <stdarg.h>
6 #include <time.h>
8d14daa @tonycoz switch to using size_t and i_img_dim strictly
authored
7 #include "imdatatypes.h"
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
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
156699a @tonycoz WIP, more context changes
authored
14 int im_init_log(pIMCTX, const char *name, int onoff );
15 #define i_init_log(name, onoff) im_init_log(aIMCTX, name, onoff)
35b70c7 @tonycoz hide i_fatal() under IMAGER_NO_CONTEXT
authored
16 #ifndef IMAGER_NO_CONTEXT
10ea52a @tonycoz re-work document and test Imager's logging facility
authored
17 void i_fatal ( int exitcode,const char *fmt, ... );
35b70c7 @tonycoz hide i_fatal() under IMAGER_NO_CONTEXT
authored
18 #endif
a482206 @tonycoz WIP, it compiles
authored
19 void im_fatal (pIMCTX, int exitcode,const char *fmt, ... );
156699a @tonycoz WIP, more context changes
authored
20 void im_lhead ( pIMCTX, const char *file, int line );
bf1573f rename some private functions to private names
Tony Cook authored
21 void i_lhead ( const char *file, int line );
8d14daa @tonycoz switch to using size_t and i_img_dim strictly
authored
22 void i_loog(int level,const char *msg, ... ) I_FORMAT_ATTR(2,3);
156699a @tonycoz WIP, more context changes
authored
23 void im_loog(pIMCTX, int level,const char *msg, ... ) I_FORMAT_ATTR(3,4);
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
24
bd8052a merge in tiff re-work branch
Tony Cook authored
25 /*
934c0e3 @tonycoz fill out documentation
authored
26 =item im_log((aIMCTX, level, format, ...))
bd8052a merge in tiff re-work branch
Tony Cook authored
27 =category Logging
28
29 This is the main entry point to logging. Note that the extra set of
30 parentheses are required due to limitations in C89 macros.
31
32 This will format a string with the current file and line number to the
33 log file if logging is enabled.
34
934c0e3 @tonycoz fill out documentation
authored
35 This must be called with a context object defined by one of the
36 C<dIMCTX> macros in scope.
37
38 This can also be called as C<mm_log((level, format, args))> in which
39 case the currently active context is used and any in scope context is
40 ignored.
41
bd8052a merge in tiff re-work branch
Tony Cook authored
42 =cut
43 */
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
44
45 #ifdef IMAGER_LOG
37f231b @tonycoz don't define mm_log() with IMAGER_NO_CONTEXT
authored
46 #ifndef IMAGER_NO_CONTEXT
bf1573f rename some private functions to private names
Tony Cook authored
47 #define mm_log(x) { i_lhead(__FILE__,__LINE__); i_loog x; }
37f231b @tonycoz don't define mm_log() with IMAGER_NO_CONTEXT
authored
48 #endif
156699a @tonycoz WIP, more context changes
authored
49 #define im_log(x) { im_lhead(aIMCTX, __FILE__,__LINE__); im_loog x; }
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
50 #else
51 #define mm_log(x)
156699a @tonycoz WIP, more context changes
authored
52 #define im_log(x)
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
53 #endif
54
55
56 #endif /* _LOG_H_ */
Something went wrong with that request. Please try again.