summaryrefslogtreecommitdiff
path: root/xkbcommon
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-08-08 14:01:46 +0200
committerDaniel Stone <daniel@fooishbar.org>2012-08-08 16:23:31 +0200
commit5e276adb9209749f1b5152853c640ec444df7051 (patch)
treed6c77df81fe9dc3c8d470903c059e05330b4824c /xkbcommon
parentba8458a9fd580d80d127ed1768f8f1d4a51ef251 (diff)
Add xkb_log_level enum rather than using syslog
Instead of relying on people including syslog.h, add our own XKB_LOG_LEVEL_* defines. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'xkbcommon')
-rw-r--r--xkbcommon/xkbcommon.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h
index 58e4183..6afe5e1 100644
--- a/xkbcommon/xkbcommon.h
+++ b/xkbcommon/xkbcommon.h
@@ -256,6 +256,19 @@ xkb_context_unref(struct xkb_context *context);
* @{
*/
+enum xkb_log_level {
+ /** Log critical internal errors only */
+ XKB_LOG_LEVEL_CRITICAL = 0,
+ /** Log all errors */
+ XKB_LOG_LEVEL_ERROR = 1,
+ /** Log warnings and errors */
+ XKB_LOG_LEVEL_WARNING = 2,
+ /** Log information, warnings, and errors */
+ XKB_LOG_LEVEL_INFO = 3,
+ /** Log all the things */
+ XKB_LOG_LEVEL_DEBUG = 4,
+};
+
/**
* Sets the function to be called for logging messages.
* Passing NULL restores the default function, which logs to stderr.
@@ -266,20 +279,18 @@ xkb_set_log_fn(struct xkb_context *context,
const char *format, va_list args));
/**
* Sets the current logging priority. The value controls which messages
- * are logged.
+ * are logged. The default priority is LOG_ERR.
*
- * The value should be one of LOG_ERR, LOG_WARNING, LOG_DEBUG, etc., see
- * syslog(3) or syslog.h. The default priority is LOG_ERR.
* The environment variable XKB_LOG, if set, overrides the default value
* and may be specified as a priority number or name.
*/
void
-xkb_set_log_priority(struct xkb_context *context, int priority);
+xkb_set_log_priority(struct xkb_context *context, enum xkb_log_level priority);
/**
* Returns the current logging priority.
*/
-int
+enum xkb_log_level
xkb_get_log_priority(struct xkb_context *context);
/**
@@ -291,7 +302,8 @@ xkb_get_log_priority(struct xkb_context *context);
* The environment variable XKB_VERBOSITY, if set, overrdies the default
* value.
*
- * Note that most verbose messages are of priority LOG_WARNING or lower.
+ * Note that most verbose messages are of priority XKB_LOG_LEVEL_WARNING
+ * or lower.
*/
void
xkb_set_log_verbosity(struct xkb_context *ctx, int verbosity);