23#ifndef MUTT_LIB_LOGGING_H
24#define MUTT_LIB_LOGGING_H
84#define mutt_debug(LEVEL, ...) MuttLogger(0, __FILE__, __LINE__, __func__, LEVEL, __VA_ARGS__)
85#define mutt_warning(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_WARNING, __VA_ARGS__)
86#define mutt_message(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_MESSAGE, __VA_ARGS__)
87#define mutt_error(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_ERROR, __VA_ARGS__)
88#define mutt_perror(...) MuttLogger(0, __FILE__, __LINE__, __func__, LL_PERROR, __VA_ARGS__)
90int log_disp_file (time_t stamp,
const char *file,
int line,
const char *function,
enum LogLevel level, ...);
91int log_disp_null (time_t stamp,
const char *file,
int line,
const char *function,
enum LogLevel level, ...);
92int log_disp_queue (time_t stamp,
const char *file,
int line,
const char *function,
enum LogLevel level, ...);
int log_disp_file(time_t stamp, const char *file, int line, const char *function, enum LogLevel level,...)
Save a log line to a file - Implements log_dispatcher_t -.
int log_disp_terminal(time_t stamp, const char *file, int line, const char *function, enum LogLevel level,...)
Save a log line to the terminal - Implements log_dispatcher_t -.
log_dispatcher_t MuttLogger
The log dispatcher -.
int log_disp_queue(time_t stamp, const char *file, int line, const char *function, enum LogLevel level,...)
Save a log line to an internal queue - Implements log_dispatcher_t -.
int log_disp_null(time_t stamp, const char *file, int line, const char *function, enum LogLevel level,...)
Discard log lines - Implements log_dispatcher_t -.
int log_file_open(bool verbose)
Start logging to a file.
STAILQ_HEAD(LogLineList, LogLine)
void log_queue_empty(void)
Free the contents of the queue.
void log_queue_set_max_size(int size)
Set a upper limit for the queue length.
int log_file_set_level(enum LogLevel level, bool verbose)
Set the logging level.
bool log_file_running(void)
Is the log file running?
void log_queue_flush(log_dispatcher_t disp)
Replay the log queue.
int(* log_dispatcher_t)(time_t stamp, const char *file, int line, const char *function, enum LogLevel level,...)
LogLevel
Names for the Logging Levels.
@ LL_DEBUG4
Log at debug level 4.
@ LL_DEBUG3
Log at debug level 3.
@ LL_PERROR
Log perror (using errno)
@ LL_DEBUG5
Log at debug level 5.
@ LL_MESSAGE
Log informational message.
@ LL_DEBUG2
Log at debug level 2.
@ LL_DEBUG1
Log at debug level 1.
@ LL_NOTIFY
Log of notifications.
int log_queue_save(FILE *fp)
Save the contents of the queue to a temporary file.
void log_file_close(bool verbose)
Close the log file.
int log_file_set_filename(const char *file, bool verbose)
Set the filename for the log.
int log_queue_add(struct LogLine *ll)
Add a LogLine to the queue.
void log_file_set_version(const char *version)
Set the program's version number.
const char * file
Source file.
char * message
Message to be logged.
const char * function
C function.
int line
Line number in source file.
STAILQ_ENTRY(LogLine) entries
Linked list.
enum LogLevel level
Log level, e.g. LL_DEBUG1.
time_t time
Timestamp of the message.