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 extern
void ast_queue_log(const
char *queuename, const
char *callid, const
char *agent, const
char *event, const
char *fmt, ...)
00044 __attribute__ ((format (printf, 5, 6)));
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 extern
void ast_verbose(const
char *fmt, ...)
00055 __attribute__ ((format (printf, 1, 2)));
00056
00057 extern
int ast_register_verbose(
void (*verboser)(const
char *string,
int opos,
int replacelast,
int complete));
00058 extern
int ast_unregister_verbose(
void (*verboser)(const
char *string,
int opos,
int replacelast,
int complete));
00059 extern
int ast_verbose_dmesg(
void (*verboser)(const
char *string,
int opos,
int replacelast,
int complete));
00060 extern
void ast_console_puts(const
char *string);
00061
00062 #define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
00063
00064 #ifdef LOG_DEBUG
00065 #undef LOG_DEBUG
00066 #endif
00067 #define __LOG_DEBUG 0
00068 #define LOG_DEBUG __LOG_DEBUG, _A_
00069
00070 #ifdef LOG_EVENT
00071 #undef LOG_EVENT
00072 #endif
00073 #define __LOG_EVENT 1
00074 #define LOG_EVENT __LOG_EVENT, _A_
00075
00076 #ifdef LOG_NOTICE
00077 #undef LOG_NOTICE
00078 #endif
00079 #define __LOG_NOTICE 2
00080 #define LOG_NOTICE __LOG_NOTICE, _A_
00081
00082 #ifdef LOG_WARNING
00083 #undef LOG_WARNING
00084 #endif
00085 #define __LOG_WARNING 3
00086 #define LOG_WARNING __LOG_WARNING, _A_
00087
00088 #ifdef LOG_ERROR
00089 #undef LOG_ERROR
00090 #endif
00091 #define __LOG_ERROR 4
00092 #define LOG_ERROR __LOG_ERROR, _A_
00093
00094 #ifdef LOG_VERBOSE
00095 #undef LOG_VERBOSE
00096 #endif
00097 #define __LOG_VERBOSE 5
00098 #define LOG_VERBOSE __LOG_VERBOSE, _A_
00099
00100 #if defined(__cplusplus) || defined(c_plusplus)
00101 }
00102 #endif
00103
00104
00105 #endif