weston-log: rename the confusing function name weston_compositor_add_log_scope()

There's a function named weston_compositor_add_log_scope()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_ctx_add_log_scope(), as
the log_scope is being added to a log_context.

Also, bump libweston_major to 9.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
This commit is contained in:
Leandro Ribeiro 2019-12-18 15:21:03 -03:00
parent ee73105f50
commit 5976dbbbb5
10 changed files with 49 additions and 50 deletions

View File

@ -3162,7 +3162,7 @@ wet_main(int argc, char *argv[])
return EXIT_FAILURE;
}
log_scope = weston_compositor_add_log_scope(log_ctx, "log",
log_scope = weston_log_ctx_add_log_scope(log_ctx, "log",
"Weston and Wayland log\n", NULL, NULL, NULL);
weston_log_file_open(log);
@ -3248,10 +3248,9 @@ wet_main(int argc, char *argv[])
segv_compositor = wet.compositor;
protocol_scope =
weston_compositor_add_log_scope(log_ctx,
"proto",
"Wayland protocol dump for all clients.\n",
NULL, NULL, NULL);
weston_log_ctx_add_log_scope(log_ctx, "proto",
"Wayland protocol dump for all clients.\n",
NULL, NULL, NULL);
protologger = wl_display_add_protocol_logger(display,
protocol_log_fn,

View File

@ -28,7 +28,7 @@ Log scopes
A scope represents a source for a data stream (i.e., a producer). You'll require
one as a way to generate data. Creating a log scope is done using
:func:`weston_compositor_add_log_scope()`. You can customize the scope
:func:`weston_log_ctx_add_log_scope()`. You can customize the scope
behaviour and you'll require at least a name and a description for the
scope.

View File

@ -55,7 +55,7 @@ struct weston_debug_stream;
*
* @param sub The subscription.
* @param user_data The \c user_data argument given to
* weston_compositor_add_log_scope()
* weston_log_ctx_add_log_scope()
*
* @memberof weston_log_scope
*/
@ -63,12 +63,12 @@ typedef void (*weston_log_scope_cb)(struct weston_log_subscription *sub,
void *user_data);
struct weston_log_scope *
weston_compositor_add_log_scope(struct weston_log_context *log_ctx,
const char *name,
const char *description,
weston_log_scope_cb new_subscription,
weston_log_scope_cb destroy_subscription,
void *user_data);
weston_log_ctx_add_log_scope(struct weston_log_context *log_ctx,
const char *name,
const char *description,
weston_log_scope_cb new_subscription,
weston_log_scope_cb destroy_subscription,
void *user_data);
void
weston_compositor_log_scope_destroy(struct weston_log_scope *scope);

View File

@ -2825,10 +2825,10 @@ drm_backend_create(struct weston_compositor *compositor,
b->pageflip_timeout = config->pageflip_timeout;
b->use_pixman_shadow = config->use_pixman_shadow;
b->debug = weston_compositor_add_log_scope(compositor->weston_log_ctx,
"drm-backend",
"Debug messages from DRM/KMS backend\n",
NULL, NULL, NULL);
b->debug = weston_log_ctx_add_log_scope(compositor->weston_log_ctx,
"drm-backend",
"Debug messages from DRM/KMS backend\n",
NULL, NULL, NULL);
compositor->backend = &b->base;

View File

@ -7321,17 +7321,17 @@ weston_compositor_create(struct wl_display *display,
WESTON_LAYER_POSITION_CURSOR);
ec->debug_scene =
weston_compositor_add_log_scope(ec->weston_log_ctx, "scene-graph",
"Scene graph details\n",
debug_scene_graph_cb, NULL,
ec);
weston_log_ctx_add_log_scope(ec->weston_log_ctx, "scene-graph",
"Scene graph details\n",
debug_scene_graph_cb, NULL,
ec);
ec->timeline =
weston_compositor_add_log_scope(ec->weston_log_ctx, "timeline",
"Timeline event points\n",
weston_timeline_create_subscription,
weston_timeline_destroy_subscription,
ec);
weston_log_ctx_add_log_scope(ec->weston_log_ctx, "timeline",
"Timeline event points\n",
weston_timeline_create_subscription,
weston_timeline_destroy_subscription,
ec);
return ec;
fail:

View File

@ -339,9 +339,9 @@ weston_compositor_enable_content_protection(struct weston_compositor *compositor
cp->destroy_listener.notify = cp_destroy_listener;
wl_signal_add(&compositor->destroy_signal, &cp->destroy_listener);
cp->debug = weston_compositor_add_log_scope(compositor->weston_log_ctx,
"content-protection-debug",
"debug-logs for content-protection",
NULL, NULL, NULL);
cp->debug = weston_log_ctx_add_log_scope(compositor->weston_log_ctx,
"content-protection-debug",
"debug-logs for content-protection",
NULL, NULL, NULL);
return 0;
}

View File

@ -355,7 +355,7 @@ weston_log_subscription_remove(struct weston_log_subscription *sub)
* matching against the \c name.
*
* @param log_ctx
* @param name the scope name, see weston_compositor_add_log_scope()
* @param name the scope name, see weston_log_ctx_add_log_scope()
* @returns NULL if none found, or a pointer to a weston_log_scope
*
* @ingroup internal-log
@ -580,12 +580,12 @@ weston_compositor_is_debug_protocol_enabled(struct weston_compositor *wc)
* @sa weston_log_scope_cb, weston_log_subscribe
*/
WL_EXPORT struct weston_log_scope *
weston_compositor_add_log_scope(struct weston_log_context *log_ctx,
const char *name,
const char *description,
weston_log_scope_cb new_subscription,
weston_log_scope_cb destroy_subscription,
void *user_data)
weston_log_ctx_add_log_scope(struct weston_log_context *log_ctx,
const char *name,
const char *description,
weston_log_scope_cb new_subscription,
weston_log_scope_cb destroy_subscription,
void *user_data)
{
struct weston_log_scope *scope;
struct weston_log_subscription *pending_sub = NULL;
@ -726,7 +726,7 @@ weston_log_subscription_complete(struct weston_log_subscription *sub)
* stream. Particularly useful for the weston-debug protocol.
*
* @memberof weston_log_scope
* @sa weston_compositor_add_log_scope, weston_compositor_log_scope_destroy
* @sa weston_log_ctx_add_log_scope, weston_compositor_log_scope_destroy
*/
WL_EXPORT void
weston_log_scope_complete(struct weston_log_scope *scope)
@ -895,9 +895,9 @@ weston_log_scope_timestamp(struct weston_log_scope *scope,
* to the scope \c scope_name.
*
* If \c scope_name has already been created (using
* weston_compositor_add_log_scope) the subscription will take place
* weston_log_ctx_add_log_scope) the subscription will take place
* immediately, otherwise we store the subscription into a pending list. See
* also weston_compositor_add_log_scope().
* also weston_log_ctx_add_log_scope().
*
* @param log_ctx the log context, used for accessing pending list
* @param subscriber the subscriber, which has to be created before

View File

@ -10,7 +10,7 @@ project('weston',
license: 'MIT/Expat',
)
libweston_major = 8
libweston_major = 9
# libweston_revision is manufactured to follow the autotools build's
# library file naming, thanks to libtool

View File

@ -822,11 +822,11 @@ weston_module_init(struct weston_compositor *compositor)
goto failed;
}
pipewire->debug = weston_compositor_add_log_scope(
compositor->weston_log_ctx,
"pipewire",
"Debug messages from pipewire plugin\n",
NULL, NULL, NULL);
pipewire->debug =
weston_log_ctx_add_log_scope(compositor->weston_log_ctx,
"pipewire",
"Debug messages from pipewire plugin\n",
NULL, NULL, NULL);
return 0;

View File

@ -396,10 +396,10 @@ weston_module_init(struct weston_compositor *compositor)
}
wxs->wm_debug =
weston_compositor_add_log_scope(wxs->compositor->weston_log_ctx,
"xwm-wm-x11",
"XWM's window management X11 events\n",
NULL, NULL, NULL);
weston_log_ctx_add_log_scope(wxs->compositor->weston_log_ctx,
"xwm-wm-x11",
"XWM's window management X11 events\n",
NULL, NULL, NULL);
return 0;