diff options
author | Karel Klic <kklic@redhat.com> | 2011-03-01 12:08:36 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2011-03-01 12:08:36 +0100 |
commit | 85f639b7fe277ba327e5013e5b101b4a67f14e1d (patch) | |
tree | 7caa3999e8c987e3ddbc26f4bfbbdc73defca73f /src/lib/logging.h | |
parent | fb52104af74bbf6eeda394880666df40b4354aba (diff) | |
parent | 77468fcdd7cc05db52320c373a24a5490ff32f52 (diff) | |
download | abrt-85f639b7fe277ba327e5013e5b101b4a67f14e1d.tar.gz abrt-85f639b7fe277ba327e5013e5b101b4a67f14e1d.tar.xz abrt-85f639b7fe277ba327e5013e5b101b4a67f14e1d.zip |
merge changes from master
Diffstat (limited to 'src/lib/logging.h')
-rw-r--r-- | src/lib/logging.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/lib/logging.h b/src/lib/logging.h index 8a038bc7..316c1a22 100644 --- a/src/lib/logging.h +++ b/src/lib/logging.h @@ -33,14 +33,6 @@ extern "C" { #define NORETURN __attribute__ ((noreturn)) -/* VERB1 log("what you sometimes want to see, even on a production box") */ -#define VERB1 if (g_verbose >= 1) -/* VERB2 log("debug message, not going into insanely small details") */ -#define VERB2 if (g_verbose >= 2) -/* VERB3 log("lots and lots of details") */ -#define VERB3 if (g_verbose >= 3) -/* there is no level > 3 */ - enum { LOGMODE_NONE = 0, LOGMODE_STDIO = (1 << 0), @@ -49,26 +41,47 @@ enum { LOGMODE_CUSTOM = (1 << 2), }; +#define g_custom_logger abrt_g_custom_logger extern void (*g_custom_logger)(const char*); +#define msg_prefix abrt_msg_prefix extern const char *msg_prefix; +#define msg_eol abrt_msg_eol extern const char *msg_eol; +#define logmode abrt_logmode extern int logmode; +#define xfunc_error_retval abrt_xfunc_error_retval extern int xfunc_error_retval; /* Verbosity level */ +#define g_verbose abrt_g_verbose extern int g_verbose; +/* VERB1 log("what you sometimes want to see, even on a production box") */ +#define VERB1 if (g_verbose >= 1) +/* VERB2 log("debug message, not going into insanely small details") */ +#define VERB2 if (g_verbose >= 2) +/* VERB3 log("lots and lots of details") */ +#define VERB3 if (g_verbose >= 3) +/* there is no level > 3 */ +#define abrt_ +#define xfunc_die abrt_xfunc_die void xfunc_die(void) NORETURN; +#define log_msg abrt_log_msg void log_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); /* It's a macro, not function, since it collides with log() from math.h */ #undef log #define log(...) log_msg(__VA_ARGS__) /* error_msg family will use g_custom_logger. log_msg does not. */ +#define error_msg abrt_error_msg void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); +#define error_msg_and_die abrt_error_msg_and_die void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); /* Reports error message with libc's errno error description attached. */ +#define perror_msg abrt_perror_msg void perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); +#define perror_msg_and_die abrt_perror_msg_and_die void perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); +#define die_out_of_memory abrt_die_out_of_memory void die_out_of_memory(void) NORETURN; #ifdef __cplusplus |