#include "asterisk/compat.h"
#include <stdarg.h>
Include dependency graph for logger.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | __LOG_DEBUG 0 |
#define | __LOG_DTMF 6 |
#define | __LOG_ERROR 4 |
#define | __LOG_EVENT 1 |
#define | __LOG_NOTICE 2 |
#define | __LOG_VERBOSE 5 |
#define | __LOG_WARNING 3 |
#define | _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__ |
#define | DEBUG_M(a) |
#define | EVENTLOG "event_log" |
#define | LOG_DEBUG __LOG_DEBUG, _A_ |
#define | LOG_DTMF __LOG_DTMF, _A_ |
#define | LOG_ERROR __LOG_ERROR, _A_ |
#define | LOG_EVENT __LOG_EVENT, _A_ |
#define | LOG_NOTICE __LOG_NOTICE, _A_ |
#define | LOG_VERBOSE __LOG_VERBOSE, _A_ |
#define | LOG_WARNING __LOG_WARNING, _A_ |
#define | QUEUELOG "queue_log" |
Functions | |
void | ast_console_puts (const char *string) |
void | ast_log (int level, const char *file, int line, const char *function, const char *fmt,...) __attribute__((format(printf |
This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments. | |
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 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)) |
void void void | ast_verbose (const char *fmt,...) __attribute__((format(printf |
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. | |
int | ast_verbose_dmesg (void(*verboser)(const char *string, int opos, int replacelast, int complete)) |
Definition in file logger.h.
void ast_log | ( | int | level, | |
const char * | file, | |||
int | line, | |||
const char * | function, | |||
const char * | fmt, | |||
... | ||||
) |
This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments.
level | Type of log event | |
file | Will be provided by the LOG_* macro | |
line | Will be provided by the LOG_* macro | |
function | Will be provided by the LOG_* macro | |
fmt | This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-) |
void void void ast_verbose | ( | const char * | fmt, | |
... | ||||
) |
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.
Send a verbose message (based on verbose level)