+
+static int default_log_level() {
+ char *env = getenv("YAZ_LOG");
+ if (env != 0)
+ return yaz_log_mask_str_x(env, YLOG_DEFAULT_LEVEL);
+ else
+ return YLOG_DEFAULT_LEVEL;
+}
+
+
+static int l_level = -1; /* will be set from default_log_level() */
+
+enum l_file_type { use_stderr, use_none, use_file };
+static enum l_file_type yaz_file_type = use_stderr;
+static FILE *yaz_global_log_file = NULL;
+
+static void (*start_hook_func)(int, const char *, void *) = NULL;
+static void *start_hook_info;
+
+static void (*end_hook_func)(int, const char *, void *) = NULL;
+static void *end_hook_info;
+
+static void (*hook_func)(int, const char *, void *) = NULL;
+static void *hook_info;
+