summaryrefslogtreecommitdiffstats
path: root/swaybar/tray/tray.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /swaybar/tray/tray.c
parentLog libinput_config_status errors (diff)
downloadsway-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/tray/tray.c')
-rw-r--r--swaybar/tray/tray.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/swaybar/tray/tray.c b/swaybar/tray/tray.c
index d5d0c84e..fcf8114f 100644
--- a/swaybar/tray/tray.c
+++ b/swaybar/tray/tray.c
@@ -17,7 +17,7 @@ static int handle_lost_watcher(sd_bus_message *msg,
17 char *service, *old_owner, *new_owner; 17 char *service, *old_owner, *new_owner;
18 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner); 18 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner);
19 if (ret < 0) { 19 if (ret < 0) {
20 wlr_log(WLR_ERROR, "Failed to parse owner change message: %s", strerror(-ret)); 20 sway_log(SWAY_ERROR, "Failed to parse owner change message: %s", strerror(-ret));
21 return ret; 21 return ret;
22 } 22 }
23 23
@@ -34,12 +34,12 @@ static int handle_lost_watcher(sd_bus_message *msg,
34} 34}
35 35
36struct swaybar_tray *create_tray(struct swaybar *bar) { 36struct swaybar_tray *create_tray(struct swaybar *bar) {
37 wlr_log(WLR_DEBUG, "Initializing tray"); 37 sway_log(SWAY_DEBUG, "Initializing tray");
38 38
39 sd_bus *bus; 39 sd_bus *bus;
40 int ret = sd_bus_open_user(&bus); 40 int ret = sd_bus_open_user(&bus);
41 if (ret < 0) { 41 if (ret < 0) {
42 wlr_log(WLR_ERROR, "Failed to connect to user bus: %s", strerror(-ret)); 42 sway_log(SWAY_ERROR, "Failed to connect to user bus: %s", strerror(-ret));
43 return NULL; 43 return NULL;
44 } 44 }
45 45
@@ -58,7 +58,7 @@ struct swaybar_tray *create_tray(struct swaybar *bar) {
58 "/org/freedesktop/DBus", "org.freedesktop.DBus", 58 "/org/freedesktop/DBus", "org.freedesktop.DBus",
59 "NameOwnerChanged", handle_lost_watcher, tray); 59 "NameOwnerChanged", handle_lost_watcher, tray);
60 if (ret < 0) { 60 if (ret < 0) {
61 wlr_log(WLR_ERROR, "Failed to subscribe to unregistering events: %s", 61 sway_log(SWAY_ERROR, "Failed to subscribe to unregistering events: %s",
62 strerror(-ret)); 62 strerror(-ret));
63 } 63 }
64 64
@@ -96,7 +96,7 @@ void tray_in(int fd, short mask, void *data) {
96 // This space intentionally left blank 96 // This space intentionally left blank
97 } 97 }
98 if (ret < 0) { 98 if (ret < 0) {
99 wlr_log(WLR_ERROR, "Failed to process bus: %s", strerror(-ret)); 99 sway_log(SWAY_ERROR, "Failed to process bus: %s", strerror(-ret));
100 } 100 }
101} 101}
102 102