From 1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 Mon Sep 17 00:00:00 2001 From: M Stoeckl Date: Sun, 20 Jan 2019 13:51:12 -0500 Subject: 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. --- swaybar/bar.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'swaybar/bar.c') diff --git a/swaybar/bar.c b/swaybar/bar.c index d36367fc..a1f7bfdb 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "config.h" #include "swaybar/bar.h" #include "swaybar/config.h" @@ -44,7 +43,7 @@ static void swaybar_output_free(struct swaybar_output *output) { if (!output) { return; } - wlr_log(WLR_DEBUG, "Removing output %s", output->name); + sway_log(SWAY_DEBUG, "Removing output %s", output->name); if (output->layer_surface != NULL) { zwlr_layer_surface_v1_destroy(output->layer_surface); } @@ -157,7 +156,7 @@ bool determine_bar_visibility(struct swaybar *bar, bool moving_layer) { bar->visible = visible; if (bar->status) { - wlr_log(WLR_DEBUG, "Sending %s signal to status command", + sway_log(SWAY_DEBUG, "Sending %s signal to status command", visible ? "cont" : "stop"); kill(bar->status->pid, visible ? bar->status->cont_signal : bar->status->stop_signal); @@ -271,7 +270,7 @@ static void xdg_output_handle_description(void *data, size_t length = paren - description; output->identifier = malloc(length); if (!output->identifier) { - wlr_log(WLR_ERROR, "Failed to allocate output identifier"); + sway_log(SWAY_ERROR, "Failed to allocate output identifier"); return; } strncpy(output->identifier, description, length); -- cgit v1.2.3-70-g09d2