00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _LOGGER_H
00015 #define _LOGGER_H
00016
00017 #include <stdarg.h>
00018
00019 #if defined(__cplusplus) || defined(c_plusplus)
00020 extern "C" {
00021 #endif
00022
00023 #define EVENTLOG "event_log"
00024
00025 #define DEBUG_M(a) { \
00026 a; \
00027 }
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 extern void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
00041 __attribute__ ((format (printf, 5, 6)));
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 extern void ast_verbose(const char *fmt, ...)
00052 __attribute__ ((format (printf, 1, 2)));
00053
00054 extern int ast_register_verbose(void (*verboser)(const char *string, int opos, int replacelast, int complete));
00055 extern int ast_unregister_verbose(void (*verboser)(const char *string, int opos, int replacelast, int complete));
00056 extern int ast_verbose_dmesg(void (*verboser)(const char *string, int opos, int replacelast, int complete));
00057 #define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
00058
00059 #define LOG_DEBUG 0, _A_
00060 #define LOG_EVENT 1, _A_
00061 #define LOG_NOTICE 2, _A_
00062 #define LOG_WARNING 3, _A_
00063 #define LOG_ERROR 4, _A_
00064
00065 #if defined(__cplusplus) || defined(c_plusplus)
00066 }
00067 #endif
00068
00069
00070 #endif