#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, _A_ |
#define | LOG_EVENT 1, _A_ |
#define | LOG_NOTICE 2, _A_ |
#define | LOG_WARNING 3, _A_ |
#define | LOG_ERROR 4, _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 | ast_verbose (const char *fmt,...) __attribute__((format(printf |
Send a verbose message (based on verbose level). | |
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)) |
|
|
|
Value: { \ a; \ } |
|
Definition at line 23 of file logger.h. Referenced by init_logger(), and reload_logger(). |
|
|
Definition at line 63 of file logger.h. Referenced by ast_channel_setoption(), ast_register_application(), ast_register_switch(), ast_unregister_application(), ast_unregister_switch(), callerid_feed(), init_logger(), load_pbx(), main(), reload_logger(), and tdd_feed(). |
|
Definition at line 60 of file logger.h. Referenced by init_logger(), and reload_logger(). |
|
|
|
|
Definition at line 366 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and malloc. Referenced by main().
00367 { 00368 struct msglist *m; 00369 struct verb *tmp; 00370 /* XXX Should be more flexible here, taking > 1 verboser XXX */ 00371 if ((tmp = malloc(sizeof (struct verb)))) { 00372 tmp->verboser = v; 00373 ast_mutex_lock(&msglist_lock); 00374 tmp->next = verboser; 00375 verboser = tmp; 00376 m = list; 00377 while(m) { 00378 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */ 00379 v(m->msg, 0, 0, 1); 00380 m = m->next; 00381 } 00382 ast_mutex_unlock(&msglist_lock); 00383 return 0; 00384 } 00385 return -1; 00386 } |
|
Definition at line 388 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and free.
00389 { 00390 int res = -1; 00391 struct verb *tmp, *tmpl=NULL; 00392 ast_mutex_lock(&msglist_lock); 00393 tmp = verboser; 00394 while(tmp) { 00395 if (tmp->verboser == v) { 00396 if (tmpl) 00397 tmpl->next = tmp->next; 00398 else 00399 verboser = tmp->next; 00400 free(tmp); 00401 break; 00402 } 00403 tmpl = tmp; 00404 tmp = tmp->next; 00405 } 00406 if (tmp) 00407 res = 0; 00408 ast_mutex_unlock(&msglist_lock); 00409 return res; 00410 } |
|
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. Referenced by ast_channel_bridge(), ast_channel_register_ex(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_create(), ast_format_register(), ast_format_unregister(), ast_frame_dump(), ast_image_register(), ast_image_unregister(), ast_load_resource(), ast_manager_register(), ast_manager_unregister(), ast_module_reload(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_pbx_run(), ast_register_application(), ast_register_indication_country(), ast_register_translator(), ast_rtp_reload(), ast_save(), ast_set_indication_country(), ast_streamfile(), ast_unregister_application(), ast_unregister_indication_country(), init_logger(), init_manager(), load_modules(), load_pbx(), main(), pbx_builtin_setvar_helper(), and reload_logger(). |
|
Definition at line 352 of file logger.c. References ast_mutex_lock, and ast_mutex_unlock.
00353 { 00354 struct msglist *m; 00355 m = list; 00356 ast_mutex_lock(&msglist_lock); 00357 while(m) { 00358 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */ 00359 v(m->msg, 0, 0, 1); 00360 m = m->next; 00361 } 00362 ast_mutex_unlock(&msglist_lock); 00363 return 0; 00364 } |