diff options
-rw-r--r-- | src/context.c | 2 | ||||
-rw-r--r-- | xkbcommon/xkbcommon.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/context.c b/src/context.c index e373d1a..81c008b 100644 --- a/src/context.c +++ b/src/context.c @@ -334,7 +334,7 @@ xkb_set_log_fn(struct xkb_context *ctx, void (*log_fn)(struct xkb_context *ctx, int priority, const char *fmt, va_list args)) { - ctx->log_fn = log_fn; + ctx->log_fn = (log_fn ? log_fn : default_log_fn); } XKB_EXPORT int diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h index 8c772ae..2b3f8e3 100644 --- a/xkbcommon/xkbcommon.h +++ b/xkbcommon/xkbcommon.h @@ -257,8 +257,8 @@ xkb_context_unref(struct xkb_context *context); */ /** - * Sets the function to be called for logging messages, instead of the - * default logger which writes to stderr. + * Sets the function to be called for logging messages. + * Passing NULL restores the default function, which logs to stderr. **/ void xkb_set_log_fn(struct xkb_context *context, |