From 55bd3dd2d67284afbe769179fdbe96ef10856b22 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 10 Oct 2011 13:06:29 +0000 Subject: log from macros --- src/include/gnunet_common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index ec54aece4..3b3288d14 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -379,6 +379,13 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); */ #define GNUNET_log_strerror(level, cmd) do { GNUNET_log(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, STRERROR(errno)); } while(0) +/** + * Log an error message at log-level 'level' that indicates + * a failure of the command 'cmd' with the message given + * by strerror(errno). + */ +#define GNUNET_log_from_strerror(level, component, cmd) do { GNUNET_log_from (level, component, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, STRERROR(errno)); } while(0) + /** * Log an error message at log-level 'level' that indicates * a failure of the command 'cmd' with the message given @@ -386,6 +393,13 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); */ #define GNUNET_log_strerror_file(level, cmd, filename) do { GNUNET_log(level, _("`%s' failed on file `%s' at %s:%d with error: %s\n"), cmd, filename,__FILE__, __LINE__, STRERROR(errno)); } while(0) +/** + * Log an error message at log-level 'level' that indicates + * a failure of the command 'cmd' with the message given + * by strerror(errno). + */ +#define GNUNET_log_from_strerror_file(level, component, cmd, filename) do { GNUNET_log_from (level, component, _("`%s' failed on file `%s' at %s:%d with error: %s\n"), cmd, filename,__FILE__, __LINE__, STRERROR(errno)); } while(0) + /* ************************* endianess conversion ****************** */ /** -- cgit v1.2.3