summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-08-06 20:04:22 +0300
committerRan Benita <ran234@gmail.com>2012-08-07 11:09:42 +0300
commitf2ecd6650aff7d8b628845c1284c7e671c01ea67 (patch)
treee3d3288d0d6d4242a860177de3dfde4b13efedfc
parent18048cb7bf49468a9211e107c000ef255db2f94f (diff)
log: allow to resore default log function
Signed-off-by: Ran Benita <ran234@gmail.com>
-rw-r--r--src/context.c2
-rw-r--r--xkbcommon/xkbcommon.h4
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,