Change log env vars to XKB_LOG_LEVEL/VERBOSITY A bit more consistent and descriptive. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
diff --git a/Makefile.am b/Makefile.am
index 26646fb..98bc307 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 = \
diff --git a/src/context.c b/src/context.c
index b3e2f23..bad4da0 100644
--- a/src/context.c
+++ b/src/context.c
@@ -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));
diff --git a/test/log.c b/test/log.c
index ac32867..08de3d8 100644
--- a/test/log.c
+++ b/test/log.c
@@ -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);
diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h
index c807c63..2cbf2cc 100644
--- a/xkbcommon/xkbcommon.h
+++ b/xkbcommon/xkbcommon.h
@@ -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