OSDN Git Service

qga: map GLib log levels to system levels
authorAndrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Tue, 29 Nov 2022 17:38:09 +0000 (19:38 +0200)
committerKonstantin Kostiuk <kkostiuk@redhat.com>
Tue, 20 Dec 2022 13:54:42 +0000 (15:54 +0200)
commit8e86851bd6b9b67fb5f6896cb85ff20c7d9bbbaa
tree0cb7ef07f8eb643323f2cda6fb7b24a32f2d6e6a
parentf9f0e6173e1d570847930abfe2b4560c7b6a964a
qga: map GLib log levels to system levels

This patch translates GLib-specific log levels to system ones, so that
they may be used by both *nix syslog() (as a "priority" argument) and
Windows ReportEvent() (as a "wType" argument).

Currently the only codepath to write to "syslog" domain is slog()
function.  However, this patch allows the interface to be extended.

Note that since slog() is using G_LOG_LEVEL_INFO level, its behaviour
doesn't change.

Originally-by: Yuri Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Tested-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
qga/main.c