#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 | 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)) |
| void | ast_console_puts (const char *string) |
|
|
Definition at line 64 of file logger.h. Referenced by ast_log(). |
|
|
|
|
|
Definition at line 70 of file logger.h. Referenced by ast_log(). |
|
|
|
|
|
Definition at line 94 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 89 of file logger.h. Referenced by ast_channel_setoption(), ast_get_group(), ast_ouraddrfor(), ast_pbx_run(), ast_register_application(), ast_register_switch(), ast_unregister_switch(), ast_verbose(), init_logger(), main(), and reload_logger(). |
|
|
Definition at line 71 of file logger.h. Referenced by ast_log(), init_logger(), and reload_logger(). |
|
|
|
Definition at line 95 of file logger.h. Referenced by ast_verbose(). |
|
|
|
Definition at line 174 of file asterisk.c. References string. Referenced by ast_log().
00175 {
00176 fputs(string, stdout);
00177 fflush(stdout);
00178 ast_network_puts(string);
00179 }
|
|
||||||||||||||||||||||||||||
|
|
Definition at line 582 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and malloc. Referenced by main().
00582 {
00583 struct msglist *m;
00584 struct verb *tmp;
00585 /* XXX Should be more flexible here, taking > 1 verboser XXX */
00586 if ((tmp = malloc(sizeof (struct verb)))) {
00587 tmp->verboser = v;
00588 ast_mutex_lock(&msglist_lock);
00589 tmp->next = verboser;
00590 verboser = tmp;
00591 m = list;
00592 while(m) {
00593 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */
00594 v(m->msg, 0, 0, 1);
00595 m = m->next;
00596 }
00597 ast_mutex_unlock(&msglist_lock);
00598 return 0;
00599 }
00600 return -1;
00601 }
00602
|
|
|
Definition at line 604 of file logger.c. References ast_mutex_lock, ast_mutex_unlock, and free.
00604 {
00605 int res = -1;
00606 struct verb *tmp, *tmpl=NULL;
00607 ast_mutex_lock(&msglist_lock);
00608 tmp = verboser;
00609 while(tmp) {
00610 if (tmp->verboser == v) {
00611 if (tmpl)
00612 tmpl->next = tmp->next;
00613 else
00614 verboser = tmp->next;
00615 free(tmp);
00616 break;
00617 }
00618 tmpl = tmp;
00619 tmp = tmp->next;
00620 }
00621 if (tmp)
00622 res = 0;
00623 ast_mutex_unlock(&msglist_lock);
00624 return res;
00625 }
00626 }
|
|
||||||||||||
|
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_channel_unregister(), ast_format_register(), ast_format_unregister(), ast_frame_dump(), ast_image_register(), ast_image_unregister(), ast_load_resource(), ast_log(), ast_manager_register(), ast_manager_unregister(), ast_module_reload(), 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_indication_country(), init_logger(), init_manager(), load_modules(), main(), pbx_builtin_setvar_helper(), and reload_logger(). |
|
|
Definition at line 568 of file logger.c. References ast_mutex_lock, and ast_mutex_unlock.
00568 {
00569 struct msglist *m;
00570 m = list;
00571 ast_mutex_lock(&msglist_lock);
00572 while(m) {
00573 /* Send all the existing entries that we have queued (i.e. they're likely to have missed) */
00574 v(m->msg, 0, 0, 1);
00575 m = m->next;
00576 }
00577 ast_mutex_unlock(&msglist_lock);
00578 return 0;
00579 }
00580
|
1.3.6-20040222