#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 238 of file asterisk.c. Referenced by ast_log().
|
|
Used for sending a log message.
|
|
|
|
Definition at line 677 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and malloc. Referenced by main(). 00678 { 00679 struct msglist *m; 00680 struct verb *tmp; 00681 /* XXX Should be more flexible here, taking > 1 verboser XXX */ 00682 if ((tmp = malloc(sizeof (struct verb)))) { 00683 tmp->verboser = v; 00684 ast_mutex_lock(&msglist_lock); 00685 tmp->next = verboser; 00686 verboser = tmp; 00687 m = list; 00688 while(m) { 00689 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */ 00690 v(m->msg, 0, 0, 1); 00691 m = m->next; 00692 } 00693 ast_mutex_unlock(&msglist_lock); 00694 return 0; 00695 } 00696 return -1; 00697 }
|
|
Definition at line 699 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and free. 00700 { 00701 int res = -1; 00702 struct verb *tmp, *tmpl=NULL; 00703 ast_mutex_lock(&msglist_lock); 00704 tmp = verboser; 00705 while(tmp) { 00706 if (tmp->verboser == v) { 00707 if (tmpl) 00708 tmpl->next = tmp->next; 00709 else 00710 verboser = tmp->next; 00711 free(tmp); 00712 break; 00713 } 00714 tmpl = tmp; 00715 tmp = tmp->next; 00716 } 00717 if (tmp) 00718 res = 0; 00719 ast_mutex_unlock(&msglist_lock); 00720 return res; 00721 }
|
|
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 663 of file logger.c. References ast_mutex_lock, and ast_mutex_unlock. 00664 { 00665 struct msglist *m; 00666 ast_mutex_lock(&msglist_lock); 00667 m = list; 00668 while(m) { 00669 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */ 00670 v(m->msg, 0, 0, 1); 00671 m = m->next; 00672 } 00673 ast_mutex_unlock(&msglist_lock); 00674 return 0; 00675 }
|