]> ruderich.org/simon Gitweb - socket2unix/socket2unix.git/blobdiff - src/socket2unix.c
Add --debug option to configure.
[socket2unix/socket2unix.git] / src / socket2unix.c
index 848a40bf68745eecf0fd9dd2bf3416d65ace8e61..e9123879fd8129f4c3b2d6e53f3ae3439267760d 100644 (file)
@@ -22,6 +22,8 @@
 /* Necessary for RTLD_NEXT. */
 #define _GNU_SOURCE
 
+#include <config.h>
+
 #include <assert.h>
 #include <dlfcn.h>
 #include <errno.h>
@@ -197,7 +199,11 @@ static const char *get_socket_path(void) {
 static int get_log_level(void) {
     const char *level = getenv("SOCKET2UNIX_DEBUG");
     if (!level) {
+#ifdef DEBUG
+        return LOG_LEVEL_DEBUG;
+#else
         return LOG_LEVEL_WARNING;
+#endif
     }
     int number = atoi(level);
     if (number <= 0 || number > LOG_LEVEL_DEBUG) {