From fe8699b7f3f219467f08631f5d9e8a99cff994c1 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 3 Jul 2019 00:26:55 +0300 Subject: [PATCH] log_level = LOG_LEVEL_INFO --- src/logging.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/logging.h b/src/logging.h index d552af9..5908d6e 100644 --- a/src/logging.h +++ b/src/logging.h @@ -44,8 +44,12 @@ pthread_mutex_t log_mutex; #define LOG_LEVEL_DEBUG 3 -#define LOGGING_INIT assert(!pthread_mutex_init(&log_mutex, NULL)) -#define LOGGING_DESTROY assert(!pthread_mutex_destroy(&log_mutex)) +#define LOGGING_INIT { \ + log_level = LOG_LEVEL_INFO; \ + assert(!pthread_mutex_init(&log_mutex, NULL)); \ + } + +#define LOGGING_DESTROY assert(!pthread_mutex_destroy(&log_mutex)) #define LOGGING_LOCK assert(!pthread_mutex_lock(&log_mutex)) #define LOGGING_UNLOCK assert(!pthread_mutex_unlock(&log_mutex))