Version 0.1.0 from FTP
[asterisk/asterisk.git] / include / asterisk / logger.h
1 /*
2  * Cheops Next Generation
3  * 
4  * Mark Spencer <markster@marko.net>
5  *
6  * Copyright(C) 1999, Adtran, Inc.
7  * 
8  * Distributed under the terms of the GNU General Public License (GPL) Version
9  *
10  * Logging routines
11  *
12  */
13
14 #ifndef _LOGGER_H
15 #define _LOGGER_H
16
17 #include <stdarg.h>
18
19 #if defined(__cplusplus) || defined(c_plusplus)
20 extern "C" {
21 #endif
22
23 #define EVENTLOG "event_log"
24
25 #define DEBUG_M(a) { \
26         a; \
27 }
28
29 extern void ast_log(int level, char *file, int line, char *function, char *fmt, ...);
30 extern void ast_verbose(char *fmt, ...);
31
32 extern int ast_register_verbose(void (*verboser)(char *string, int opos, int replacelast, int complete));
33 extern int ast_unregister_verbose(void (*verboser)(char *string, int opos, int replacelast, int complete));
34
35 #define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
36
37 #define LOG_DEBUG       0, _A_
38 #define LOG_EVENT   1, _A_
39 #define LOG_NOTICE  2, _A_
40 #define LOG_WARNING 3, _A_
41 #define LOG_ERROR       4, _A_
42
43 #if defined(__cplusplus) || defined(c_plusplus)
44 }
45 #endif
46
47
48 #endif