summaryrefslogtreecommitdiff
path: root/sway/server.c
diff options
context:
space:
mode:
authorM Stoeckl <[email protected]>2019-01-20 13:51:12 -0500
committeremersion <[email protected]>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /sway/server.c
parent5c834d36e14aaeca4ac1d22b869254d5722af4af (diff)
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'sway/server.c')
-rw-r--r--sway/server.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sway/server.c b/sway/server.c
index 0529cab1..5ae9bb01 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -19,9 +19,9 @@
#include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_output_v1.h>
-#include <wlr/util/log.h>
#include "config.h"
#include "list.h"
+#include "log.h"
#include "sway/config.h"
#include "sway/desktop/idle_inhibit_v1.h"
#include "sway/input/input-manager.h"
@@ -32,20 +32,20 @@
#endif
bool server_privileged_prepare(struct sway_server *server) {
- wlr_log(WLR_DEBUG, "Preparing Wayland server initialization");
+ sway_log(SWAY_DEBUG, "Preparing Wayland server initialization");
server->wl_display = wl_display_create();
server->wl_event_loop = wl_display_get_event_loop(server->wl_display);
server->backend = wlr_backend_autocreate(server->wl_display, NULL);
if (!server->backend) {
- wlr_log(WLR_ERROR, "Unable to create backend");
+ sway_log(SWAY_ERROR, "Unable to create backend");
return false;
}
return true;
}
bool server_init(struct sway_server *server) {
- wlr_log(WLR_DEBUG, "Initializing Wayland server");
+ sway_log(SWAY_DEBUG, "Initializing Wayland server");
struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend);
assert(renderer);
@@ -111,7 +111,7 @@ bool server_init(struct sway_server *server) {
server->socket = wl_display_add_socket_auto(server->wl_display);
if (!server->socket) {
- wlr_log(WLR_ERROR, "Unable to open wayland socket");
+ sway_log(SWAY_ERROR, "Unable to open wayland socket");
wlr_backend_destroy(server->backend);
return false;
}
@@ -155,7 +155,7 @@ bool server_start(struct sway_server *server) {
#if HAVE_XWAYLAND
if (config->xwayland) {
- wlr_log(WLR_DEBUG, "Initializing Xwayland");
+ sway_log(SWAY_DEBUG, "Initializing Xwayland");
server->xwayland.wlr_xwayland =
wlr_xwayland_create(server->wl_display, server->compositor, true);
wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface,
@@ -179,10 +179,10 @@ bool server_start(struct sway_server *server) {
}
#endif
- wlr_log(WLR_INFO, "Starting backend on wayland display '%s'",
+ sway_log(SWAY_INFO, "Starting backend on wayland display '%s'",
server->socket);
if (!wlr_backend_start(server->backend)) {
- wlr_log(WLR_ERROR, "Failed to start backend");
+ sway_log(SWAY_ERROR, "Failed to start backend");
wlr_backend_destroy(server->backend);
return false;
}
@@ -190,7 +190,7 @@ bool server_start(struct sway_server *server) {
}
void server_run(struct sway_server *server) {
- wlr_log(WLR_INFO, "Running compositor on wayland display '%s'",
+ sway_log(SWAY_INFO, "Running compositor on wayland display '%s'",
server->socket);
wl_display_run(server->wl_display);
}