Add logging API
authorRan Benita <ran234@gmail.com>
Fri, 20 Jul 2012 10:10:13 +0000 (13:10 +0300)
committerRan Benita <ran234@gmail.com>
Sun, 22 Jul 2012 21:45:34 +0000 (00:45 +0300)
commit70f35cfbc0e41ce5ddf1d5a9b7b0a7731e68d5bf
tree0d7553541568cba33b3f4c9a35493b91a843a32f
parent71c2f2e0e2dce7e3ada36ee7399421eb18a2e302
Add logging API

Add new public API to provide the library users with some options to
control and customize the logging output from the library. It is based
upon the skeleton from the libabc demo libray:
https://git.kernel.org/?p=linux/kernel/git/kay/libabc.git
which is public domain and works pretty well.

This requires passing in the context object in every logging call, and
thus the conversion is done file by file. We also remove the global
warningLevel variable in favor of a verbosity level in the context,
which can be set by the user and is silent by default.

One issue is the ACTION calls, which, while nice, do not play very well
with line- and priority-based logging, and would require some
line continuation handling or keeping state or some other compromise. So
instead remove these and just inline them with their respective
warning/error. So instead of:
    ERROR("Memory allocation failed\n")
    ACTION("Removing all files on hardisk\n")
its something like that:
    log_err("Memory allocation failed; Removing all files on harddisk\n")

Signed-off-by: Ran Benita <ran234@gmail.com>
Makefile.am
src/context.c
src/utils.c [deleted file]
src/utils.h
src/xkb-priv.h
xkbcommon/xkbcommon.h