From 8d7d9792d1e97abf09d6b93605884590e02f346e Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 28 Aug 2012 00:42:59 +0300 Subject: log: replace "priority" by "level" everywhere Now that we don't use syslog, "level" does sound more commonplace. We should change it while there is still nobody using it. Also leave some space between the integers of the xkb_log_level enum values, if we ever need to shove more in between. Signed-off-by: Ran Benita --- xkbcommon/xkbcommon.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'xkbcommon') diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h index 9fc6c7b..6333f97 100644 --- a/xkbcommon/xkbcommon.h +++ b/xkbcommon/xkbcommon.h @@ -258,15 +258,15 @@ xkb_context_unref(struct xkb_context *context); enum xkb_log_level { /** Log critical internal errors only */ - XKB_LOG_LEVEL_CRITICAL = 0, + XKB_LOG_LEVEL_CRITICAL = 10, /** Log all errors */ - XKB_LOG_LEVEL_ERROR = 1, + XKB_LOG_LEVEL_ERROR = 20, /** Log warnings and errors */ - XKB_LOG_LEVEL_WARNING = 2, + XKB_LOG_LEVEL_WARNING = 30, /** Log information, warnings, and errors */ - XKB_LOG_LEVEL_INFO = 3, + XKB_LOG_LEVEL_INFO = 40, /** Log all the things */ - XKB_LOG_LEVEL_DEBUG = 4, + XKB_LOG_LEVEL_DEBUG = 50, }; /** @@ -275,23 +275,24 @@ enum xkb_log_level { **/ void xkb_set_log_fn(struct xkb_context *context, - void (*log_fn)(struct xkb_context *context, int priority, + void (*log_fn)(struct xkb_context *context, + enum xkb_log_level level, const char *format, va_list args)); /** - * Sets the current logging priority. The value controls which messages - * are logged. The default priority is LOG_ERR. + * Sets the current logging level. The value controls which messages + * are logged. The default level is XKB_LOG_LEVEL_ERROR. * * The environment variable XKB_LOG, if set, overrides the default value - * and may be specified as a priority number or name. + * and may be specified as a level number or name. */ void -xkb_set_log_priority(struct xkb_context *context, enum xkb_log_level priority); +xkb_set_log_level(struct xkb_context *context, enum xkb_log_level level); /** - * Returns the current logging priority. + * Returns the current logging level. */ enum xkb_log_level -xkb_get_log_priority(struct xkb_context *context); +xkb_get_log_level(struct xkb_context *context); /** * Sets the current logging verbosity, a value from 0 to 10. @@ -302,7 +303,7 @@ 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 XKB_LOG_LEVEL_WARNING + * Note that most verbose messages are of level XKB_LOG_LEVEL_WARNING * or lower. */ void -- cgit v1.2.3