diff options
author | M Stoeckl <code@mstoeckl.com> | 2019-01-20 13:51:12 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-21 12:59:42 +0100 |
commit | 1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch) | |
tree | 5c3f60e0219cb8b4a1b7cafb760a871661866e32 /swaybar/bar.c | |
parent | Log libinput_config_status errors (diff) | |
download | sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip |
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 'swaybar/bar.c')
-rw-r--r-- | swaybar/bar.c | 7 |
1 files changed, 3 insertions, 4 deletions
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 @@ | |||
10 | #include <unistd.h> | 10 | #include <unistd.h> |
11 | #include <wayland-client.h> | 11 | #include <wayland-client.h> |
12 | #include <wayland-cursor.h> | 12 | #include <wayland-cursor.h> |
13 | #include <wlr/util/log.h> | ||
14 | #include "config.h" | 13 | #include "config.h" |
15 | #include "swaybar/bar.h" | 14 | #include "swaybar/bar.h" |
16 | #include "swaybar/config.h" | 15 | #include "swaybar/config.h" |
@@ -44,7 +43,7 @@ static void swaybar_output_free(struct swaybar_output *output) { | |||
44 | if (!output) { | 43 | if (!output) { |
45 | return; | 44 | return; |
46 | } | 45 | } |
47 | wlr_log(WLR_DEBUG, "Removing output %s", output->name); | 46 | sway_log(SWAY_DEBUG, "Removing output %s", output->name); |
48 | if (output->layer_surface != NULL) { | 47 | if (output->layer_surface != NULL) { |
49 | zwlr_layer_surface_v1_destroy(output->layer_surface); | 48 | zwlr_layer_surface_v1_destroy(output->layer_surface); |
50 | } | 49 | } |
@@ -157,7 +156,7 @@ bool determine_bar_visibility(struct swaybar *bar, bool moving_layer) { | |||
157 | bar->visible = visible; | 156 | bar->visible = visible; |
158 | 157 | ||
159 | if (bar->status) { | 158 | if (bar->status) { |
160 | wlr_log(WLR_DEBUG, "Sending %s signal to status command", | 159 | sway_log(SWAY_DEBUG, "Sending %s signal to status command", |
161 | visible ? "cont" : "stop"); | 160 | visible ? "cont" : "stop"); |
162 | kill(bar->status->pid, visible ? | 161 | kill(bar->status->pid, visible ? |
163 | bar->status->cont_signal : bar->status->stop_signal); | 162 | bar->status->cont_signal : bar->status->stop_signal); |
@@ -271,7 +270,7 @@ static void xdg_output_handle_description(void *data, | |||
271 | size_t length = paren - description; | 270 | size_t length = paren - description; |
272 | output->identifier = malloc(length); | 271 | output->identifier = malloc(length); |
273 | if (!output->identifier) { | 272 | if (!output->identifier) { |
274 | wlr_log(WLR_ERROR, "Failed to allocate output identifier"); | 273 | sway_log(SWAY_ERROR, "Failed to allocate output identifier"); |
275 | return; | 274 | return; |
276 | } | 275 | } |
277 | strncpy(output->identifier, description, length); | 276 | strncpy(output->identifier, description, length); |