#include <stdarg.h>Go to the source code of this file.
Defines | |
| #define | EVENTLOG "event_log" |
| #define | DEBUG_M(a) |
| #define | _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__ |
| #define | __LOG_DEBUG 0 |
| #define | LOG_DEBUG __LOG_DEBUG, _A_ |
| #define | __LOG_EVENT 1 |
| #define | LOG_EVENT __LOG_EVENT, _A_ |
| #define | __LOG_NOTICE 2 |
| #define | LOG_NOTICE __LOG_NOTICE, _A_ |
| #define | __LOG_WARNING 3 |
| #define | LOG_WARNING __LOG_WARNING, _A_ |
| #define | __LOG_ERROR 4 |
| #define | LOG_ERROR __LOG_ERROR, _A_ |
| #define | __LOG_VERBOSE 5 |
| #define | LOG_VERBOSE __LOG_VERBOSE, _A_ |
Functions | |
| void | ast_log (int level, const char *file, int line, const char *function, const char *fmt,...) __attribute__((format(printf |
| Used for sending a log message. | |
| void void | ast_queue_log (const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt,...) __attribute__((format(printf |
| void void void | ast_verbose (const char *fmt,...) __attribute__((format(printf |
| Send a verbose message (based on verbose level). | |
| void void void int | ast_register_verbose (void(*verboser)(const char *string, int opos, int replacelast, int complete)) |
| int | ast_unregister_verbose (void(*verboser)(const char *string, int opos, int replacelast, int complete)) |
| int | ast_verbose_dmesg (void(*verboser)(const char *string, int opos, int replacelast, int complete)) |
| void | ast_console_puts (const char *string) |
|
|
Definition at line 67 of file logger.h. Referenced by ast_log(). |
|
|
|
|
|
Definition at line 73 of file logger.h. Referenced by ast_log(). |
|
|
|
|
|
Definition at line 97 of file logger.h. Referenced by ast_log(). |
|
|
|
|
|
|
|
|
Value: { \
a; \
}
|
|
|
Definition at line 23 of file logger.h. Referenced by init_logger(), and reload_logger(). |
|
|
|
|
Definition at line 74 of file logger.h. Referenced by ast_log(), init_logger(), and reload_logger(). |
|
|
|
Definition at line 98 of file logger.h. Referenced by ast_verbose(). |
|
|
|
Definition at line 237 of file asterisk.c. Referenced by ast_log().
|
|
||||||||||||||||||||||||||||
|
Used for sending a log message.
|
|
||||||||||||||||||||||||||||
|
|
|
|
Definition at line 710 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and malloc. Referenced by main(). 00711 { 00712 struct msglist *m; 00713 struct verb *tmp; 00714 /* XXX Should be more flexible here, taking > 1 verboser XXX */ 00715 if ((tmp = malloc(sizeof (struct verb)))) { 00716 tmp->verboser = v; 00717 ast_mutex_lock(&msglist_lock); 00718 tmp->next = verboser; 00719 verboser = tmp; 00720 m = list; 00721 while(m) { 00722 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */ 00723 v(m->msg, 0, 0, 1); 00724 m = m->next; 00725 } 00726 ast_mutex_unlock(&msglist_lock); 00727 return 0; 00728 } 00729 return -1; 00730 }
|
|
|
Definition at line 732 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and free. 00733 { 00734 int res = -1; 00735 struct verb *tmp, *tmpl=NULL; 00736 ast_mutex_lock(&msglist_lock); 00737 tmp = verboser; 00738 while(tmp) { 00739 if (tmp->verboser == v) { 00740 if (tmpl) 00741 tmpl->next = tmp->next; 00742 else 00743 verboser = tmp->next; 00744 free(tmp); 00745 break; 00746 } 00747 tmpl = tmp; 00748 tmp = tmp->next; 00749 } 00750 if (tmp) 00751 res = 0; 00752 ast_mutex_unlock(&msglist_lock); 00753 return res; 00754 }
|
|
||||||||||||
|
Send a verbose message (based on verbose level). This works like ast_log, but prints verbose messages to the console depending on verbosity level set. ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing"); This will print the message to the console if the verbose level is set to a level >= 3 Note the abscence of a comma after the VERBOSE_PREFIX_3. This is important. VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined. |
|
|
Definition at line 696 of file logger.c. References ast_mutex_lock, and ast_mutex_unlock. 00697 { 00698 struct msglist *m; 00699 ast_mutex_lock(&msglist_lock); 00700 m = list; 00701 while(m) { 00702 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */ 00703 v(m->msg, 0, 0, 1); 00704 m = m->next; 00705 } 00706 ast_mutex_unlock(&msglist_lock); 00707 return 0; 00708 }
|
1.4.4