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 extern void ast_console_puts(const char *string);
00058
00059 #define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
00060
00061 #ifdef LOG_DEBUG
00062 #undef LOG_DEBUG
00063 #endif
00064 #define __LOG_DEBUG 0
00065 #define LOG_DEBUG __LOG_DEBUG, _A_
00066
00067 #ifdef LOG_EVENT
00068 #undef LOG_EVENT
00069 #endif
00070 #define __LOG_EVENT 1
00071 #define LOG_EVENT __LOG_EVENT, _A_
00072
00073 #ifdef LOG_NOTICE
00074 #undef LOG_NOTICE
00075 #endif
00076 #define __LOG_NOTICE 2
00077 #define LOG_NOTICE __LOG_NOTICE, _A_
00078
00079 #ifdef LOG_WARNING
00080 #undef LOG_WARNING
00081 #endif
00082 #define __LOG_WARNING 3
00083 #define LOG_WARNING __LOG_WARNING, _A_
00084
00085 #ifdef LOG_ERROR
00086 #undef LOG_ERROR
00087 #endif
00088 #define __LOG_ERROR 4
00089 #define LOG_ERROR __LOG_ERROR, _A_
00090
00091 #ifdef LOG_VERBOSE
00092 #undef LOG_VERBOSE
00093 #endif
00094 #define __LOG_VERBOSE 5
00095 #define LOG_VERBOSE __LOG_VERBOSE, _A_
00096
00097 #if defined(__cplusplus) || defined(c_plusplus)
00098 }
00099 #endif
00100
00101
00102 #endif