mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
Wayland: logging
The core libwayland libraries should not handle logging, only passing the error messages to subscribed functions. An application linked to libwayland-server or libwayland-client will be able to set own functions (one per library) to handle error messages. Change in this series: make the wl_log return int, because of compatibility with printf. It will return the number of bytes logged.
This commit is contained in:
parent
b858a1b87b
commit
8e2a786703
7 changed files with 41 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "wayland-util.h"
|
||||
#include "wayland-private.h"
|
||||
|
|
@ -270,3 +271,20 @@ wl_map_for_each(struct wl_map *map, wl_iterator_func_t func, void *data)
|
|||
for_each_helper(&map->client_entries, func, data);
|
||||
for_each_helper(&map->server_entries, func, data);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_log_noop_handler(const char *fmt, va_list arg)
|
||||
{
|
||||
}
|
||||
|
||||
wl_log_func_t wl_log_handler = wl_log_noop_handler;
|
||||
|
||||
void
|
||||
wl_log(const char *fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
|
||||
va_start(argp, fmt);
|
||||
wl_log_handler(fmt, argp);
|
||||
va_end(argp);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue