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>
dev
Leandro Ribeiro 5 years ago
parent ee73105f50
commit 5976dbbbb5
  1. 5
      compositor/main.c
  2. 2
      doc/sphinx/toc/libweston/log.rst
  3. 4
      include/libweston/weston-log.h
  4. 2
      libweston/backend-drm/drm.c
  5. 4
      libweston/compositor.c
  6. 2
      libweston/content-protection.c
  7. 10
      libweston/weston-log.c
  8. 2
      meson.build
  9. 4
      pipewire/pipewire-plugin.c
  10. 2
      xwayland/launcher.c

@ -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,8 +3248,7 @@ wet_main(int argc, char *argv[])
segv_compositor = wet.compositor;
protocol_scope =
weston_compositor_add_log_scope(log_ctx,
"proto",
weston_log_ctx_add_log_scope(log_ctx, "proto",
"Wayland protocol dump for all clients.\n",
NULL, NULL, NULL);

@ -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.

@ -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,7 +63,7 @@ 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,
weston_log_ctx_add_log_scope(struct weston_log_context *log_ctx,
const char *name,
const char *description,
weston_log_scope_cb new_subscription,

@ -2825,7 +2825,7 @@ 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,
b->debug = weston_log_ctx_add_log_scope(compositor->weston_log_ctx,
"drm-backend",
"Debug messages from DRM/KMS backend\n",
NULL, NULL, NULL);

@ -7321,13 +7321,13 @@ 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",
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",
weston_log_ctx_add_log_scope(ec->weston_log_ctx, "timeline",
"Timeline event points\n",
weston_timeline_create_subscription,
weston_timeline_destroy_subscription,

@ -339,7 +339,7 @@ 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,
cp->debug = weston_log_ctx_add_log_scope(compositor->weston_log_ctx,
"content-protection-debug",
"debug-logs for content-protection",
NULL, NULL, NULL);

@ -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,7 +580,7 @@ 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,
weston_log_ctx_add_log_scope(struct weston_log_context *log_ctx,
const char *name,
const char *description,
weston_log_scope_cb new_subscription,
@ -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

@ -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

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

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

Loading…
Cancel
Save