summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2013-11-22 14:40:37 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2013-11-27 11:41:44 +0100
commit11d6cb2f1bee70ee68bf63e3c09877906e033283 (patch)
treeb647c1247c5d7b4d24b7ca4656e21615db396ba9
parentc32120176b47c4bf4d9b0d0f1c691adafcef89da (diff)
downloadgnutls-11d6cb2f1bee70ee68bf63e3c09877906e033283.tar.gz
simplified debugging levels.
-rw-r--r--lib/gnutls_errors.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/gnutls_errors.h b/lib/gnutls_errors.h
index 12df2588b9..e96e7c9b87 100644
--- a/lib/gnutls_errors.h
+++ b/lib/gnutls_errors.h
@@ -30,7 +30,7 @@
#ifdef __FILE__
#ifdef __LINE__
-#define gnutls_assert() _gnutls_debug_log( "ASSERT: %s:%d\n", __FILE__,__LINE__);
+#define gnutls_assert() _gnutls_assert_log( "ASSERT: %s:%d\n", __FILE__,__LINE__);
#else
#define gnutls_assert()
#endif
@@ -59,20 +59,21 @@ void _gnutls_mpi_log(const char *prefix, bigint_t a);
#define LEVEL(l, ...) do { if (unlikely(_gnutls_log_level >= l)) \
_gnutls_log( l, __VA_ARGS__); } while(0)
-#define LEVEL_EQ(l, ...) do { if (unlikely(_gnutls_log_level == l || _gnutls_log_level > 9)) \
- _gnutls_log( l, __VA_ARGS__); } while(0)
-
#define _gnutls_debug_log(...) LEVEL(2, __VA_ARGS__)
-#define _gnutls_handshake_log(...) LEVEL(3, __VA_ARGS__)
-#define _gnutls_io_log(...) LEVEL_EQ(5, __VA_ARGS__)
-#define _gnutls_buffers_log(...) LEVEL_EQ(6, __VA_ARGS__)
-#define _gnutls_hard_log(...) LEVEL(9, __VA_ARGS__)
-#define _gnutls_record_log(...) LEVEL(4, __VA_ARGS__)
+#define _gnutls_assert_log(...) LEVEL(3, __VA_ARGS__)
+#define _gnutls_handshake_log(...) LEVEL(4, __VA_ARGS__)
+#define _gnutls_record_log(...) LEVEL(5, __VA_ARGS__)
#define _gnutls_dtls_log(...) LEVEL(6, __VA_ARGS__)
-#define _gnutls_read_log(...) LEVEL_EQ(7, __VA_ARGS__)
-#define _gnutls_write_log(...) LEVEL_EQ(7, __VA_ARGS__)
+
+#define _gnutls_hard_log(...) LEVEL(9, __VA_ARGS__)
+
+#define _gnutls_read_log(...) LEVEL(10, __VA_ARGS__)
+#define _gnutls_write_log(...) LEVEL(11, __VA_ARGS__)
+#define _gnutls_io_log(...) LEVEL(12, __VA_ARGS__)
+#define _gnutls_buffers_log(...) LEVEL(13, __VA_ARGS__)
#else
#define _gnutls_debug_log _gnutls_null_log
+#define _gnutls_assert_log _gnutls_null_log
#define _gnutls_handshake_log _gnutls_null_log
#define _gnutls_io_log _gnutls_null_log
#define _gnutls_buffers_log _gnutls_null_log
@@ -96,7 +97,7 @@ static inline
#endif
int gnutls_assert_val_int(int val, const char *file, int line)
{
- _gnutls_debug_log("ASSERT: %s:%d\n", file, line);
+ gnutls_assert();
return val;
}