From: Christian Grothoff Date: Mon, 10 Oct 2011 13:06:29 +0000 (+0000) Subject: log from macros X-Git-Tag: initial-import-from-subversion-38251~16664 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=55bd3dd2d67284afbe769179fdbe96ef10856b22;p=oweals%2Fgnunet.git log from macros --- 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 ****************** */ /**