*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-log_fn(struct xkb_context *ctx, int priority, const char *fmt, va_list args)
+log_fn(struct xkb_context *ctx, enum xkb_log_level level,
+ const char *fmt, va_list args)
darray_append_lit(*ls, ": ");
darray_append_string(*ls, s);
free(s);
darray_append_lit(*ls, ": ");
darray_append_string(*ls, s);
free(s);
- ret = setenv("XKB_LOG", "warn", 1);
- ret = setenv("XKB_VERBOSITY", "5", 1);
+ ret = setenv("XKB_LOG_LEVEL", "warn", 1);
- xkb_set_user_data(ctx, &log_string);
- xkb_set_log_fn(ctx, log_fn);
+ xkb_context_set_user_data(ctx, &log_string);
+ xkb_context_set_log_fn(ctx, log_fn);
log_warn(ctx, "first warning: %d\n", 87);
log_info(ctx, "first info\n");
log_dbg(ctx, "first debug: %s\n", "hello");
log_err(ctx, "first error: %lu\n", 115415UL);
log_warn(ctx, "first warning: %d\n", 87);
log_info(ctx, "first info\n");
log_dbg(ctx, "first debug: %s\n", "hello");
log_err(ctx, "first error: %lu\n", 115415UL);
log_warn(ctx, "second warning: %d\n", 87);
log_dbg(ctx, "second debug: %s %s\n", "hello", "world");
log_info(ctx, "second info\n");
log_err(ctx, "second error: %lu\n", 115415UL);
log_warn(ctx, "second warning: %d\n", 87);
log_dbg(ctx, "second debug: %s %s\n", "hello", "world");
log_info(ctx, "second info\n");
log_err(ctx, "second error: %lu\n", 115415UL);
- xkb_set_log_verbosity(ctx, 0);
- xkb_set_log_priority(ctx, -1);
+ xkb_context_set_log_verbosity(ctx, 0);
+ xkb_context_set_log_level(ctx, XKB_LOG_LEVEL_CRITICAL);
log_warn(ctx, "third warning: %d\n", 87);
log_dbg(ctx, "third debug: %s %s\n", "hello", "world");
log_info(ctx, "third info\n");
log_err(ctx, "third error: %lu\n", 115415UL);
log_warn(ctx, "third warning: %d\n", 87);
log_dbg(ctx, "third debug: %s %s\n", "hello", "world");
log_info(ctx, "third info\n");
log_err(ctx, "third error: %lu\n", 115415UL);