diff --git a/src/compose/table.c b/src/compose/table.c index 14261b2e5..122c712b9 100644 --- a/src/compose/table.c +++ b/src/compose/table.c @@ -100,12 +100,14 @@ xkb_compose_table_new_from_file(struct xkb_context *ctx, bool ok; if (flags & ~(XKB_COMPOSE_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } if (format != XKB_COMPOSE_FORMAT_TEXT_V1) { - log_err_func(ctx, "unsupported compose format: %d\n", format); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unsupported compose format: %d\n", format); return NULL; } @@ -133,12 +135,14 @@ xkb_compose_table_new_from_buffer(struct xkb_context *ctx, bool ok; if (flags & ~(XKB_COMPOSE_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } if (format != XKB_COMPOSE_FORMAT_TEXT_V1) { - log_err_func(ctx, "unsupported compose format: %d\n", format); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unsupported compose format: %d\n", format); return NULL; } @@ -166,7 +170,8 @@ xkb_compose_table_new_from_locale(struct xkb_context *ctx, bool ok; if (flags & ~(XKB_COMPOSE_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } diff --git a/src/context.h b/src/context.h index a523d90dd..6b0ddb0ca 100644 --- a/src/context.h +++ b/src/context.h @@ -152,21 +152,21 @@ xkb_context_sanitize_rule_names(struct xkb_context *ctx, xkb_log_with_code((ctx), XKB_LOG_LEVEL_INFO, 0, id, __VA_ARGS__) #define log_warn(ctx, id, ...) \ xkb_log_with_code((ctx), XKB_LOG_LEVEL_WARNING, 0, id, __VA_ARGS__) +#define log_vrb(ctx, vrb, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_WARNING, (vrb), id, __VA_ARGS__) #define log_err(ctx, id, ...) \ xkb_log_with_code((ctx), XKB_LOG_LEVEL_ERROR, 0, id, __VA_ARGS__) #define log_wsgo(ctx, id, ...) \ xkb_log_with_code((ctx), XKB_LOG_LEVEL_CRITICAL, 0, id, __VA_ARGS__) -#define log_vrb(ctx, vrb, id, ...) \ - xkb_log_with_code((ctx), XKB_LOG_LEVEL_WARNING, (vrb), id, __VA_ARGS__) /* * Variants which are prefixed by the name of the function they're * called from. * Here we must have the silly 1 variant. */ -#define log_err_func(ctx, fmt, ...) \ - log_err(ctx, XKB_LOG_MESSAGE_NO_ID, "%s: " fmt, __func__, __VA_ARGS__) -#define log_err_func1(ctx, fmt) \ - log_err(ctx, XKB_LOG_MESSAGE_NO_ID, "%s: " fmt, __func__) +#define log_err_func(ctx, id, fmt, ...) \ + log_err(ctx, id, "%s: " fmt, __func__, __VA_ARGS__) +#define log_err_func1(ctx, id, fmt) \ + log_err(ctx, id, "%s: " fmt, __func__) #endif diff --git a/src/keymap.c b/src/keymap.c index 0291aedbb..fd76a11c7 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -128,12 +128,14 @@ xkb_keymap_new_from_names(struct xkb_context *ctx, ops = get_keymap_format_ops(format); if (!ops || !ops->keymap_new_from_names) { - log_err_func(ctx, "unsupported keymap format: %d\n", format); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unsupported keymap format: %d\n", format); return NULL; } if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } @@ -176,17 +178,20 @@ xkb_keymap_new_from_buffer(struct xkb_context *ctx, ops = get_keymap_format_ops(format); if (!ops || !ops->keymap_new_from_string) { - log_err_func(ctx, "unsupported keymap format: %d\n", format); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unsupported keymap format: %d\n", format); return NULL; } if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } if (!buffer) { - log_err_func1(ctx, "no buffer specified\n"); + log_err_func1(ctx, XKB_LOG_MESSAGE_NO_ID, + "no buffer specified\n"); return NULL; } @@ -217,17 +222,20 @@ xkb_keymap_new_from_file(struct xkb_context *ctx, ops = get_keymap_format_ops(format); if (!ops || !ops->keymap_new_from_file) { - log_err_func(ctx, "unsupported keymap format: %d\n", format); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unsupported keymap format: %d\n", format); return NULL; } if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } if (!file) { - log_err_func1(ctx, "no file specified\n"); + log_err_func1(ctx, XKB_LOG_MESSAGE_NO_ID, + "no file specified\n"); return NULL; } @@ -254,7 +262,8 @@ xkb_keymap_get_as_string(struct xkb_keymap *keymap, ops = get_keymap_format_ops(format); if (!ops || !ops->keymap_get_as_string) { - log_err_func(keymap->ctx, "unsupported keymap format: %d\n", format); + log_err_func(keymap->ctx, XKB_LOG_MESSAGE_NO_ID, + "unsupported keymap format: %d\n", format); return NULL; } diff --git a/src/state.c b/src/state.c index d5a60eb57..287f0eef8 100644 --- a/src/state.c +++ b/src/state.c @@ -1574,7 +1574,7 @@ xkb_state_key_get_consumed_mods2(struct xkb_state *state, xkb_keycode_t kc, case XKB_CONSUMED_MODE_GTK: break; default: - log_err_func(state->keymap->ctx, + log_err_func(state->keymap->ctx, XKB_LOG_MESSAGE_NO_ID, "unrecognized consumed modifiers mode: %d\n", mode); return 0; } diff --git a/src/x11/keymap.c b/src/x11/keymap.c index 72f663927..5328e9687 100644 --- a/src/x11/keymap.c +++ b/src/x11/keymap.c @@ -1143,12 +1143,14 @@ xkb_x11_keymap_new_from_device(struct xkb_context *ctx, const enum xkb_keymap_format format = XKB_KEYMAP_FORMAT_TEXT_V1; if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) { - log_err_func(ctx, "unrecognized flags: %#x\n", flags); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "unrecognized flags: %#x\n", flags); return NULL; } if (device_id < 0 || device_id > 127) { - log_err_func(ctx, "illegal device ID: %d\n", device_id); + log_err_func(ctx, XKB_LOG_MESSAGE_NO_ID, + "illegal device ID: %d\n", device_id); return NULL; } diff --git a/src/x11/state.c b/src/x11/state.c index d1118803e..ba903c0e3 100644 --- a/src/x11/state.c +++ b/src/x11/state.c @@ -56,7 +56,8 @@ xkb_x11_state_new_from_device(struct xkb_keymap *keymap, struct xkb_state *state; if (device_id < 0 || device_id > 255) { - log_err_func(keymap->ctx, "illegal device ID: %d", device_id); + log_err_func(keymap->ctx, XKB_LOG_MESSAGE_NO_ID, + "illegal device ID: %d", device_id); return NULL; }