00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _ASTERISK_LOGGER_H
00026 #define _ASTERISK_LOGGER_H
00027
00028 #include "asterisk/compat.h"
00029
00030 #include <stdarg.h>
00031
00032 #if defined(__cplusplus) || defined(c_plusplus)
00033 extern "C" {
00034 #endif
00035
00036 #define EVENTLOG "event_log"
00037 #define QUEUELOG "queue_log"
00038
00039 #define DEBUG_M(a) { \
00040 a; \
00041 }
00042
00043 #define VERBOSE_PREFIX_1 " "
00044 #define VERBOSE_PREFIX_2 " == "
00045 #define VERBOSE_PREFIX_3 " -- "
00046 #define VERBOSE_PREFIX_4 " > "
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
00063 __attribute__((format(printf, 5, 6)));
00064
00065 void ast_backtrace(void);
00066
00067
00068 int logger_reload(void);
00069
00070 void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
00071 __attribute__((format(printf, 5, 6)));
00072
00073
00074
00075
00076
00077
00078
00079
00080 void ast_verbose(const char *fmt, ...)
00081 __attribute__((format(printf, 1, 2)));
00082
00083 int ast_register_verbose(void (*verboser)(const char *string));
00084 int ast_unregister_verbose(void (*verboser)(const char *string));
00085
00086 void ast_console_puts(const char *string);
00087
00088 void ast_console_puts_mutable(const char *string);
00089 void ast_console_toggle_mute(int fd, int silent);
00090
00091 #define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
00092
00093 #ifdef LOG_DEBUG
00094 #undef LOG_DEBUG
00095 #endif
00096 #define __LOG_DEBUG 0
00097 #define LOG_DEBUG __LOG_DEBUG, _A_
00098
00099 #ifdef LOG_EVENT
00100 #undef LOG_EVENT
00101 #endif
00102 #define __LOG_EVENT 1
00103 #define LOG_EVENT __LOG_EVENT, _A_
00104
00105 #ifdef LOG_NOTICE
00106 #undef LOG_NOTICE
00107 #endif
00108 #define __LOG_NOTICE 2
00109 #define LOG_NOTICE __LOG_NOTICE, _A_
00110
00111 #ifdef LOG_WARNING
00112 #undef LOG_WARNING
00113 #endif
00114 #define __LOG_WARNING 3
00115 #define LOG_WARNING __LOG_WARNING, _A_
00116
00117 #ifdef LOG_ERROR
00118 #undef LOG_ERROR
00119 #endif
00120 #define __LOG_ERROR 4
00121 #define LOG_ERROR __LOG_ERROR, _A_
00122
00123 #ifdef LOG_VERBOSE
00124 #undef LOG_VERBOSE
00125 #endif
00126 #define __LOG_VERBOSE 5
00127 #define LOG_VERBOSE __LOG_VERBOSE, _A_
00128
00129 #ifdef LOG_DTMF
00130 #undef LOG_DTMF
00131 #endif
00132 #define __LOG_DTMF 6
00133 #define LOG_DTMF __LOG_DTMF, _A_
00134
00135 #if defined(__cplusplus) || defined(c_plusplus)
00136 }
00137 #endif
00138
00139 #endif