X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..006827074fe1dc0b85de76982e1b9bf5cda07e34:/lib/log.h diff --git a/lib/log.h b/lib/log.h index e7f6e43..ecabd30 100644 --- a/lib/log.h +++ b/lib/log.h @@ -30,17 +30,29 @@ void set_progname(char **argv); void elog(int pri, int errno_value, const char *fmt, va_list ap); -void fatal(int errno_value, const char *msg, ...) attribute((noreturn)) +void disorder_fatal(int errno_value, const char *msg, ...) attribute((noreturn)) attribute((format (printf, 2, 3))); -void error(int errno_value, const char *msg, ...) +void disorder_error(int errno_value, const char *msg, ...) attribute((format (printf, 2, 3))); -void info(const char *msg, ...) +void disorder_info(const char *msg, ...) attribute((format (printf, 1, 2))); -void debug(const char *msg, ...) +void disorder_debug(const char *msg, ...) attribute((format (printf, 1, 2))); /* report a message of the given class. @errno_value@ if present an * non-zero is included. @fatal@ terminates the process. */ +/** @brief Backward-compatibility alias for disorder_fatal() */ +#define fatal disorder_fatal + +/** @brief Backward-compatibility alias for disorder_error() */ +#define error disorder_error + +/** @brief Backward-compatibility alias for disorder_info() */ +#define info disorder_info + +/** @brief Backward-compatibility alias for disorder_debug() */ +#define debug disorder_debug + extern int debugging; /* set when debugging enabled */ @@ -55,7 +67,13 @@ extern struct log_output log_stderr, log_syslog, *log_default; extern const char *debug_filename; extern int debug_lineno; +extern int logdate; +/** @brief Issue a debug message if debugging is turned on + * @param x Parenthesized debug arguments + * + * Use in the format: D(("format string", arg, arg, ...)); + */ #define D(x) do { \ if(debugging) { \ debug_filename=__FILE__; \