Change log env vars to XKB_LOG_LEVEL/VERBOSITY
authorRan Benita <ran234@gmail.com>
Fri, 12 Oct 2012 08:15:43 +0000 (10:15 +0200)
committerRan Benita <ran234@gmail.com>
Fri, 12 Oct 2012 08:17:57 +0000 (10:17 +0200)
A bit more consistent and descriptive.

Signed-off-by: Ran Benita <ran234@gmail.com>
Makefile.am
src/context.c
test/log.c
xkbcommon/xkbcommon.h

index 26646fb..98bc307 100644 (file)
@@ -135,8 +135,8 @@ libtest_la_SOURCES = \
        test/common.c
 
 AM_TESTS_ENVIRONMENT = \
-       XKB_LOG=debug; export XKB_LOG; \
-       XKB_VERBOSITY=10; export XKB_VERBOSITY; \
+       XKB_LOG_LEVEL=debug; export XKB_LOG_LEVEL; \
+       XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
        $(XORG_MALLOC_DEBUG_ENV)
 
 TESTS = \
index b3e2f23..bad4da0 100644 (file)
@@ -294,11 +294,11 @@ xkb_context_new(enum xkb_context_flags flags)
     ctx->log_verbosity = 0;
 
     /* Environment overwrites defaults. */
-    env = getenv("XKB_LOG");
+    env = getenv("XKB_LOG_LEVEL");
     if (env)
         xkb_context_set_log_level(ctx, log_level(env));
 
-    env = getenv("XKB_VERBOSITY");
+    env = getenv("XKB_LOG_VERBOSITY");
     if (env)
         xkb_context_set_log_verbosity(ctx, log_verbosity(env));
 
index ac32867..08de3d8 100644 (file)
@@ -70,9 +70,9 @@ main(void)
     struct xkb_context *ctx;
     int ret;
 
-    ret = setenv("XKB_LOG", "warn", 1);
+    ret = setenv("XKB_LOG_LEVEL", "warn", 1);
     assert(ret == 0);
-    ret = setenv("XKB_VERBOSITY", "5", 1);
+    ret = setenv("XKB_LOG_VERBOSITY", "5", 1);
     assert(ret == 0);
     ctx = xkb_context_new(0);
     assert(ctx);
index c807c63..2cbf2cc 100644 (file)
@@ -399,8 +399,8 @@ enum xkb_log_level {
  * and below will be logged.
  *
  * The default level is XKB_LOG_LEVEL_ERROR.  The environment variable
- * XKB_LOG, if set in the time the context was created, overrides the default
- * value.  It may be specified as a level number or name.
+ * XKB_LOG_LEVEL, if set in the time the context was created, overrides the
+ * default value.  It may be specified as a level number or name.
  */
 void
 xkb_context_set_log_level(struct xkb_context *context,
@@ -420,8 +420,8 @@ xkb_context_get_log_level(struct xkb_context *context);
  * ordinary users of the library.  The verbosity may be increased if more
  * information is desired (e.g. when developing a new keymap).
  *
- * The default verbosity is 0.  The environment variable XKB_VERBOSITY, if
- * set in the time the context was created, overrdies the default value.
+ * The default verbosity is 0.  The environment variable XKB_LOG_VERBOSITY,
+ * if set in the time the context was created, overrides the default value.
  *
  * @param context   The context in which to use the set verbosity.
  * @param verbosity The verbosity to use.  Currently used values are