log from macros
authorChristian Grothoff <christian@grothoff.org>
Mon, 10 Oct 2011 13:06:29 +0000 (13:06 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 10 Oct 2011 13:06:29 +0000 (13:06 +0000)
src/include/gnunet_common.h

index ec54aece4c2597160d292232ef19b2adca1c4c9e..3b3288d14c9e9966e64d95e5584d15c2ec5196b4 100644 (file)
@@ -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 ****************** */
 
 /**