Prototype for a Logging Function. More...
Macros | |
#define | mutt_debug(LEVEL, ...) MuttLogger(0, __FILE__, __LINE__, __func__, LEVEL, __VA_ARGS__) |
#define | mutt_warning(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_WARNING, __VA_ARGS__) |
#define | mutt_message(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_MESSAGE, __VA_ARGS__) |
#define | mutt_error(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_ERROR, __VA_ARGS__) |
#define | mutt_perror(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_PERROR, __VA_ARGS__) |
Functions | |
int | log_disp_debug (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...) |
Display a log line on screen - Implements log_dispatcher_t -. | |
static int | log_disp_null (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...) |
Discard log lines - Implements log_dispatcher_t -. | |
int | log_disp_file (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...) |
Save a log line to a file - Implements log_dispatcher_t -. | |
int | log_disp_queue (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...) |
Save a log line to an internal queue - Implements log_dispatcher_t -. | |
int | log_disp_terminal (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...) |
Save a log line to the terminal - Implements log_dispatcher_t -. | |
int | log_disp_curses (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...) |
Display a log line in the message line - Implements log_dispatcher_t -. | |
Variables | |
log_dispatcher_t | MuttLogger = log_disp_terminal |
The log dispatcher -. | |
Prototype for a Logging Function.
stamp | Unix time (optional) |
file | Source file |
line | Source line |
function | Source function |
level | Logging level, e.g. LL_WARNING |
format | printf()-style formatting string |
... | Parameters, like printf() |
-1 | Error |
0 | Success, filtered |
>0 | Success, number of characters written |
#define mutt_debug | ( | LEVEL, | |
... | |||
) | MuttLogger(0, __FILE__, __LINE__, __func__, LEVEL, __VA_ARGS__) |
Definition at line 89 of file logging2.h.
#define mutt_warning | ( | ... | ) | MuttLogger(0, __FILE__, __LINE__, __func__, LL_WARNING, __VA_ARGS__) |
Definition at line 90 of file logging2.h.
#define mutt_message | ( | ... | ) | MuttLogger(0, __FILE__, __LINE__, __func__, LL_MESSAGE, __VA_ARGS__) |
Definition at line 91 of file logging2.h.
#define mutt_error | ( | ... | ) | MuttLogger(0, __FILE__, __LINE__, __func__, LL_ERROR, __VA_ARGS__) |
Definition at line 92 of file logging2.h.
#define mutt_perror | ( | ... | ) | MuttLogger(0, __FILE__, __LINE__, __func__, LL_PERROR, __VA_ARGS__) |
Definition at line 93 of file logging2.h.
int log_disp_debug | ( | time_t | stamp, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
enum LogLevel | level, | ||
const char * | format, | ||
... | |||
) |
Display a log line on screen - Implements log_dispatcher_t -.
Definition at line 74 of file logging.c.
|
static |
Discard log lines - Implements log_dispatcher_t -.
Definition at line 16 of file address.c.
int log_disp_file | ( | time_t | stamp, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
enum LogLevel | level, | ||
const char * | format, | ||
... | |||
) |
Save a log line to a file - Implements log_dispatcher_t -.
This log dispatcher saves a line of text to a file. The format is:
[TIMESTAMP]<LEVEL> FUNCTION() FORMATTED-MESSAGE
The caller must first set LogFileName and LogFileLevel, then call log_file_open(). Any logging above LogFileLevel will be ignored.
If stamp is 0, then the current time will be used.
Definition at line 246 of file logging.c.
int log_disp_queue | ( | time_t | stamp, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
enum LogLevel | level, | ||
const char * | format, | ||
... | |||
) |
Save a log line to an internal queue - Implements log_dispatcher_t -.
This log dispatcher saves a line of text to a queue. The format string and parameters are expanded and the other parameters are stored as they are.
Definition at line 398 of file logging.c.
int log_disp_terminal | ( | time_t | stamp, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
enum LogLevel | level, | ||
const char * | format, | ||
... | |||
) |
Save a log line to the terminal - Implements log_dispatcher_t -.
This log dispatcher saves a line of text to the terminal. The format is:
[TIMESTAMP]<LEVEL> FUNCTION() FORMATTED-MESSAGE
Definition at line 441 of file logging.c.
int log_disp_curses | ( | time_t | stamp, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
enum LogLevel | level, | ||
const char * | format, | ||
... | |||
) |
Display a log line in the message line - Implements log_dispatcher_t -.
Definition at line 88 of file mutt_logging.c.
log_dispatcher_t MuttLogger = log_disp_terminal |