aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
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 /sway/commands
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 'sway/commands')
-rw-r--r--sway/commands/assign.c2
-rw-r--r--sway/commands/bar.c8
-rw-r--r--sway/commands/bar/bind.c4
-rw-r--r--sway/commands/bar/binding_mode_indicator.c4
-rw-r--r--sway/commands/bar/font.c2
-rw-r--r--sway/commands/bar/gaps.c2
-rw-r--r--sway/commands/bar/height.c2
-rw-r--r--sway/commands/bar/hidden_state.c2
-rw-r--r--sway/commands/bar/icon_theme.c2
-rw-r--r--sway/commands/bar/id.c2
-rw-r--r--sway/commands/bar/mode.c2
-rw-r--r--sway/commands/bar/modifier.c2
-rw-r--r--sway/commands/bar/output.c2
-rw-r--r--sway/commands/bar/pango_markup.c4
-rw-r--r--sway/commands/bar/position.c2
-rw-r--r--sway/commands/bar/separator_symbol.c2
-rw-r--r--sway/commands/bar/status_command.c2
-rw-r--r--sway/commands/bar/status_edge_padding.c2
-rw-r--r--sway/commands/bar/status_padding.c2
-rw-r--r--sway/commands/bar/strip_workspace_name.c4
-rw-r--r--sway/commands/bar/strip_workspace_numbers.c4
-rw-r--r--sway/commands/bar/swaybar_command.c2
-rw-r--r--sway/commands/bar/tray_bind.c4
-rw-r--r--sway/commands/bar/tray_output.c4
-rw-r--r--sway/commands/bar/tray_padding.c2
-rw-r--r--sway/commands/bar/workspace_buttons.c4
-rw-r--r--sway/commands/bar/wrap_scroll.c4
-rw-r--r--sway/commands/bind.c8
-rw-r--r--sway/commands/client.c2
-rw-r--r--sway/commands/exec.c2
-rw-r--r--sway/commands/exec_always.c8
-rw-r--r--sway/commands/floating_minmax_size.c1
-rw-r--r--sway/commands/focus.c1
-rw-r--r--sway/commands/for_window.c2
-rw-r--r--sway/commands/input.c2
-rw-r--r--sway/commands/input/xkb_layout.c2
-rw-r--r--sway/commands/input/xkb_model.c2
-rw-r--r--sway/commands/input/xkb_options.c2
-rw-r--r--sway/commands/input/xkb_rules.c2
-rw-r--r--sway/commands/input/xkb_variant.c2
-rw-r--r--sway/commands/kill.c1
-rw-r--r--sway/commands/mode.c2
-rw-r--r--sway/commands/move.c15
-rw-r--r--sway/commands/output.c2
-rw-r--r--sway/commands/output/background.c8
-rw-r--r--sway/commands/reload.c2
-rw-r--r--sway/commands/rename.c2
-rw-r--r--sway/commands/resize.c1
-rw-r--r--sway/commands/scratchpad.c8
-rw-r--r--sway/commands/swap.c3
-rw-r--r--sway/commands/swaybg_command.c2
-rw-r--r--sway/commands/swaynag_command.c2
-rw-r--r--sway/commands/xwayland.c2
53 files changed, 79 insertions, 85 deletions
diff --git a/sway/commands/assign.c b/sway/commands/assign.c
index 3bd1f65d..976bc3cc 100644
--- a/sway/commands/assign.c
+++ b/sway/commands/assign.c
@@ -56,7 +56,7 @@ struct cmd_results *cmd_assign(int argc, char **argv) {
56 criteria->target = join_args(argv, argc); 56 criteria->target = join_args(argv, argc);
57 57
58 list_add(config->criteria, criteria); 58 list_add(config->criteria, criteria);
59 wlr_log(WLR_DEBUG, "assign: '%s' -> '%s' added", criteria->raw, 59 sway_log(SWAY_DEBUG, "assign: '%s' -> '%s' added", criteria->raw,
60 criteria->target); 60 criteria->target);
61 61
62 return cmd_results_new(CMD_SUCCESS, NULL); 62 return cmd_results_new(CMD_SUCCESS, NULL);
diff --git a/sway/commands/bar.c b/sway/commands/bar.c
index 2cfc538f..e9360603 100644
--- a/sway/commands/bar.c
+++ b/sway/commands/bar.c
@@ -1,9 +1,9 @@
1#define _POSIX_C_SOURCE 200809 1#define _POSIX_C_SOURCE 200809
2#include <string.h> 2#include <string.h>
3#include <strings.h> 3#include <strings.h>
4#include <wlr/util/log.h>
5#include "sway/commands.h" 4#include "sway/commands.h"
6#include "sway/config.h" 5#include "sway/config.h"
6#include "log.h"
7#include "util.h" 7#include "util.h"
8 8
9// Must be in alphabetical order for bsearch 9// Must be in alphabetical order for bsearch
@@ -60,14 +60,14 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
60 for (int i = 0; i < config->bars->length; ++i) { 60 for (int i = 0; i < config->bars->length; ++i) {
61 struct bar_config *item = config->bars->items[i]; 61 struct bar_config *item = config->bars->items[i];
62 if (strcmp(item->id, argv[0]) == 0) { 62 if (strcmp(item->id, argv[0]) == 0) {
63 wlr_log(WLR_DEBUG, "Selecting bar: %s", argv[0]); 63 sway_log(SWAY_DEBUG, "Selecting bar: %s", argv[0]);
64 bar = item; 64 bar = item;
65 break; 65 break;
66 } 66 }
67 } 67 }
68 if (!bar) { 68 if (!bar) {
69 spawn = !config->reading; 69 spawn = !config->reading;
70 wlr_log(WLR_DEBUG, "Creating bar: %s", argv[0]); 70 sway_log(SWAY_DEBUG, "Creating bar: %s", argv[0]);
71 bar = default_bar_config(); 71 bar = default_bar_config();
72 if (!bar) { 72 if (!bar) {
73 return cmd_results_new(CMD_FAILURE, 73 return cmd_results_new(CMD_FAILURE,
@@ -99,7 +99,7 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
99 99
100 // Set current bar 100 // Set current bar
101 config->current_bar = bar; 101 config->current_bar = bar;
102 wlr_log(WLR_DEBUG, "Creating bar %s", bar->id); 102 sway_log(SWAY_DEBUG, "Creating bar %s", bar->id);
103 } 103 }
104 104
105 if (find_handler(argv[0], bar_config_handlers, 105 if (find_handler(argv[0], bar_config_handlers,
diff --git a/sway/commands/bar/bind.c b/sway/commands/bar/bind.c
index 4b0be804..17030a05 100644
--- a/sway/commands/bar/bind.c
+++ b/sway/commands/bar/bind.c
@@ -59,7 +59,7 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) {
59 overwritten = true; 59 overwritten = true;
60 bindings->items[i] = binding; 60 bindings->items[i] = binding;
61 free_bar_binding(other); 61 free_bar_binding(other);
62 wlr_log(WLR_DEBUG, "[bar %s] Updated binding for %u (%s)%s", 62 sway_log(SWAY_DEBUG, "[bar %s] Updated binding for %u (%s)%s",
63 config->current_bar->id, binding->button, name, 63 config->current_bar->id, binding->button, name,
64 binding->release ? " - release" : ""); 64 binding->release ? " - release" : "");
65 break; 65 break;
@@ -67,7 +67,7 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) {
67 } 67 }
68 if (!overwritten) { 68 if (!overwritten) {
69 list_add(bindings, binding); 69 list_add(bindings, binding);
70 wlr_log(WLR_DEBUG, "[bar %s] Added binding for %u (%s)%s", 70 sway_log(SWAY_DEBUG, "[bar %s] Added binding for %u (%s)%s",
71 config->current_bar->id, binding->button, name, 71 config->current_bar->id, binding->button, name,
72 binding->release ? " - release" : ""); 72 binding->release ? " - release" : "");
73 } 73 }
diff --git a/sway/commands/bar/binding_mode_indicator.c b/sway/commands/bar/binding_mode_indicator.c
index 15acc309..29c93ddc 100644
--- a/sway/commands/bar/binding_mode_indicator.c
+++ b/sway/commands/bar/binding_mode_indicator.c
@@ -16,10 +16,10 @@ struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
16 config->current_bar->binding_mode_indicator = 16 config->current_bar->binding_mode_indicator =
17 parse_boolean(argv[0], config->current_bar->binding_mode_indicator); 17 parse_boolean(argv[0], config->current_bar->binding_mode_indicator);
18 if (config->current_bar->binding_mode_indicator) { 18 if (config->current_bar->binding_mode_indicator) {
19 wlr_log(WLR_DEBUG, "Enabling binding mode indicator on bar: %s", 19 sway_log(SWAY_DEBUG, "Enabling binding mode indicator on bar: %s",
20 config->current_bar->id); 20 config->current_bar->id);
21 } else { 21 } else {
22 wlr_log(WLR_DEBUG, "Disabling binding mode indicator on bar: %s", 22 sway_log(SWAY_DEBUG, "Disabling binding mode indicator on bar: %s",
23 config->current_bar->id); 23 config->current_bar->id);
24 } 24 }
25 return cmd_results_new(CMD_SUCCESS, NULL); 25 return cmd_results_new(CMD_SUCCESS, NULL);
diff --git a/sway/commands/bar/font.c b/sway/commands/bar/font.c
index c6147e3d..cf1f759e 100644
--- a/sway/commands/bar/font.c
+++ b/sway/commands/bar/font.c
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_font(int argc, char **argv) {
15 char *font = join_args(argv, argc); 15 char *font = join_args(argv, argc);
16 free(config->current_bar->font); 16 free(config->current_bar->font);
17 config->current_bar->font = font; 17 config->current_bar->font = font;
18 wlr_log(WLR_DEBUG, "Settings font '%s' for bar: %s", 18 sway_log(SWAY_DEBUG, "Settings font '%s' for bar: %s",
19 config->current_bar->font, config->current_bar->id); 19 config->current_bar->font, config->current_bar->id);
20 return cmd_results_new(CMD_SUCCESS, NULL); 20 return cmd_results_new(CMD_SUCCESS, NULL);
21} 21}
diff --git a/sway/commands/bar/gaps.c b/sway/commands/bar/gaps.c
index fabe12fc..83480fb5 100644
--- a/sway/commands/bar/gaps.c
+++ b/sway/commands/bar/gaps.c
@@ -47,7 +47,7 @@ struct cmd_results *bar_cmd_gaps(int argc, char **argv) {
47 config->current_bar->gaps.bottom = bottom; 47 config->current_bar->gaps.bottom = bottom;
48 config->current_bar->gaps.left = left; 48 config->current_bar->gaps.left = left;
49 49
50 wlr_log(WLR_DEBUG, "Setting bar gaps to %d %d %d %d on bar: %s", 50 sway_log(SWAY_DEBUG, "Setting bar gaps to %d %d %d %d on bar: %s",
51 config->current_bar->gaps.top, config->current_bar->gaps.right, 51 config->current_bar->gaps.top, config->current_bar->gaps.right,
52 config->current_bar->gaps.bottom, config->current_bar->gaps.left, 52 config->current_bar->gaps.bottom, config->current_bar->gaps.left,
53 config->current_bar->id); 53 config->current_bar->id);
diff --git a/sway/commands/bar/height.c b/sway/commands/bar/height.c
index a2e72533..945eb707 100644
--- a/sway/commands/bar/height.c
+++ b/sway/commands/bar/height.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_height(int argc, char **argv) {
14 "Invalid height value: %s", argv[0]); 14 "Invalid height value: %s", argv[0]);
15 } 15 }
16 config->current_bar->height = height; 16 config->current_bar->height = height;
17 wlr_log(WLR_DEBUG, "Setting bar height to %d on bar: %s", 17 sway_log(SWAY_DEBUG, "Setting bar height to %d on bar: %s",
18 height, config->current_bar->id); 18 height, config->current_bar->id);
19 return cmd_results_new(CMD_SUCCESS, NULL); 19 return cmd_results_new(CMD_SUCCESS, NULL);
20} 20}
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c
index 3364ce70..b2c2d245 100644
--- a/sway/commands/bar/hidden_state.c
+++ b/sway/commands/bar/hidden_state.c
@@ -26,7 +26,7 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar,
26 if (!config->reading) { 26 if (!config->reading) {
27 ipc_event_barconfig_update(bar); 27 ipc_event_barconfig_update(bar);
28 } 28 }
29 wlr_log(WLR_DEBUG, "Setting hidden_state: '%s' for bar: %s", 29 sway_log(SWAY_DEBUG, "Setting hidden_state: '%s' for bar: %s",
30 bar->hidden_state, bar->id); 30 bar->hidden_state, bar->id);
31 } 31 }
32 // free old mode 32 // free old mode
diff --git a/sway/commands/bar/icon_theme.c b/sway/commands/bar/icon_theme.c
index 2d16f748..54b7b16e 100644
--- a/sway/commands/bar/icon_theme.c
+++ b/sway/commands/bar/icon_theme.c
@@ -16,7 +16,7 @@ struct cmd_results *bar_cmd_icon_theme(int argc, char **argv) {
16 return cmd_results_new(CMD_FAILURE, "No bar defined."); 16 return cmd_results_new(CMD_FAILURE, "No bar defined.");
17 } 17 }
18 18
19 wlr_log(WLR_DEBUG, "[Bar %s] Setting icon theme to %s", 19 sway_log(SWAY_DEBUG, "[Bar %s] Setting icon theme to %s",
20 config->current_bar->id, argv[0]); 20 config->current_bar->id, argv[0]);
21 free(config->current_bar->icon_theme); 21 free(config->current_bar->icon_theme);
22 config->current_bar->icon_theme = strdup(argv[0]); 22 config->current_bar->icon_theme = strdup(argv[0]);
diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c
index bef3023b..a9a61743 100644
--- a/sway/commands/bar/id.c
+++ b/sway/commands/bar/id.c
@@ -26,7 +26,7 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
26 } 26 }
27 } 27 }
28 28
29 wlr_log(WLR_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name); 29 sway_log(SWAY_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name);
30 30
31 // free old bar id 31 // free old bar id
32 free(config->current_bar->id); 32 free(config->current_bar->id);
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c
index 1698db8d..d89ddf24 100644
--- a/sway/commands/bar/mode.c
+++ b/sway/commands/bar/mode.c
@@ -28,7 +28,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode
28 if (!config->reading) { 28 if (!config->reading) {
29 ipc_event_barconfig_update(bar); 29 ipc_event_barconfig_update(bar);
30 } 30 }
31 wlr_log(WLR_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); 31 sway_log(SWAY_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id);
32 } 32 }
33 33
34 // free old mode 34 // free old mode
diff --git a/sway/commands/bar/modifier.c b/sway/commands/bar/modifier.c
index 0d28d6a2..62ec681f 100644
--- a/sway/commands/bar/modifier.c
+++ b/sway/commands/bar/modifier.c
@@ -29,7 +29,7 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
29 } 29 }
30 list_free_items_and_destroy(split); 30 list_free_items_and_destroy(split);
31 config->current_bar->modifier = mod; 31 config->current_bar->modifier = mod;
32 wlr_log(WLR_DEBUG, 32 sway_log(SWAY_DEBUG,
33 "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]); 33 "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]);
34 return cmd_results_new(CMD_SUCCESS, NULL); 34 return cmd_results_new(CMD_SUCCESS, NULL);
35} 35}
diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c
index 9ad10678..956c1959 100644
--- a/sway/commands/bar/output.c
+++ b/sway/commands/bar/output.c
@@ -42,7 +42,7 @@ struct cmd_results *bar_cmd_output(int argc, char **argv) {
42 42
43 if (add_output) { 43 if (add_output) {
44 list_add(outputs, strdup(output)); 44 list_add(outputs, strdup(output));
45 wlr_log(WLR_DEBUG, "Adding bar: '%s' to output '%s'", 45 sway_log(SWAY_DEBUG, "Adding bar: '%s' to output '%s'",
46 config->current_bar->id, output); 46 config->current_bar->id, output);
47 } 47 }
48 return cmd_results_new(CMD_SUCCESS, NULL); 48 return cmd_results_new(CMD_SUCCESS, NULL);
diff --git a/sway/commands/bar/pango_markup.c b/sway/commands/bar/pango_markup.c
index 0ffa41d9..b0958cf1 100644
--- a/sway/commands/bar/pango_markup.c
+++ b/sway/commands/bar/pango_markup.c
@@ -15,10 +15,10 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
15 config->current_bar->pango_markup 15 config->current_bar->pango_markup
16 = parse_boolean(argv[0], config->current_bar->pango_markup); 16 = parse_boolean(argv[0], config->current_bar->pango_markup);
17 if (config->current_bar->pango_markup) { 17 if (config->current_bar->pango_markup) {
18 wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s", 18 sway_log(SWAY_DEBUG, "Enabling pango markup for bar: %s",
19 config->current_bar->id); 19 config->current_bar->id);
20 } else { 20 } else {
21 wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s", 21 sway_log(SWAY_DEBUG, "Disabling pango markup for bar: %s",
22 config->current_bar->id); 22 config->current_bar->id);
23 } 23 }
24 return cmd_results_new(CMD_SUCCESS, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL);
diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c
index 2e3f79b4..4456d724 100644
--- a/sway/commands/bar/position.c
+++ b/sway/commands/bar/position.c
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_position(int argc, char **argv) {
15 char *valid[] = { "top", "bottom" }; 15 char *valid[] = { "top", "bottom" };
16 for (size_t i = 0; i < sizeof(valid) / sizeof(valid[0]); ++i) { 16 for (size_t i = 0; i < sizeof(valid) / sizeof(valid[0]); ++i) {
17 if (strcasecmp(valid[i], argv[0]) == 0) { 17 if (strcasecmp(valid[i], argv[0]) == 0) {
18 wlr_log(WLR_DEBUG, "Setting bar position '%s' for bar: %s", 18 sway_log(SWAY_DEBUG, "Setting bar position '%s' for bar: %s",
19 argv[0], config->current_bar->id); 19 argv[0], config->current_bar->id);
20 free(config->current_bar->position); 20 free(config->current_bar->position);
21 config->current_bar->position = strdup(argv[0]); 21 config->current_bar->position = strdup(argv[0]);
diff --git a/sway/commands/bar/separator_symbol.c b/sway/commands/bar/separator_symbol.c
index 145cdea5..76e99b49 100644
--- a/sway/commands/bar/separator_symbol.c
+++ b/sway/commands/bar/separator_symbol.c
@@ -13,7 +13,7 @@ struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) {
13 } 13 }
14 free(config->current_bar->separator_symbol); 14 free(config->current_bar->separator_symbol);
15 config->current_bar->separator_symbol = strdup(argv[0]); 15 config->current_bar->separator_symbol = strdup(argv[0]);
16 wlr_log(WLR_DEBUG, "Settings separator_symbol '%s' for bar: %s", 16 sway_log(SWAY_DEBUG, "Settings separator_symbol '%s' for bar: %s",
17 config->current_bar->separator_symbol, config->current_bar->id); 17 config->current_bar->separator_symbol, config->current_bar->id);
18 return cmd_results_new(CMD_SUCCESS, NULL); 18 return cmd_results_new(CMD_SUCCESS, NULL);
19} 19}
diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c
index c379cc72..0b58e5fa 100644
--- a/sway/commands/bar/status_command.c
+++ b/sway/commands/bar/status_command.c
@@ -17,7 +17,7 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) {
17 char *new_command = join_args(argv, argc); 17 char *new_command = join_args(argv, argc);
18 if (strcmp(new_command, "-") != 0) { 18 if (strcmp(new_command, "-") != 0) {
19 config->current_bar->status_command = new_command; 19 config->current_bar->status_command = new_command;
20 wlr_log(WLR_DEBUG, "Feeding bar with status command: %s", 20 sway_log(SWAY_DEBUG, "Feeding bar with status command: %s",
21 config->current_bar->status_command); 21 config->current_bar->status_command);
22 } else { 22 } else {
23 free(new_command); 23 free(new_command);
diff --git a/sway/commands/bar/status_edge_padding.c b/sway/commands/bar/status_edge_padding.c
index 565ab9a9..75ef86f0 100644
--- a/sway/commands/bar/status_edge_padding.c
+++ b/sway/commands/bar/status_edge_padding.c
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_status_edge_padding(int argc, char **argv) {
15 "Padding must be a positive integer"); 15 "Padding must be a positive integer");
16 } 16 }
17 config->current_bar->status_edge_padding = padding; 17 config->current_bar->status_edge_padding = padding;
18 wlr_log(WLR_DEBUG, "Status edge padding on bar %s: %d", 18 sway_log(SWAY_DEBUG, "Status edge padding on bar %s: %d",
19 config->current_bar->id, config->current_bar->status_edge_padding); 19 config->current_bar->id, config->current_bar->status_edge_padding);
20 return cmd_results_new(CMD_SUCCESS, NULL); 20 return cmd_results_new(CMD_SUCCESS, NULL);
21} 21}
diff --git a/sway/commands/bar/status_padding.c b/sway/commands/bar/status_padding.c
index 7a69a25d..0c65e516 100644
--- a/sway/commands/bar/status_padding.c
+++ b/sway/commands/bar/status_padding.c
@@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_status_padding(int argc, char **argv) {
15 "Padding must be a positive integer"); 15 "Padding must be a positive integer");
16 } 16 }
17 config->current_bar->status_padding = padding; 17 config->current_bar->status_padding = padding;
18 wlr_log(WLR_DEBUG, "Status padding on bar %s: %d", 18 sway_log(SWAY_DEBUG, "Status padding on bar %s: %d",
19 config->current_bar->id, config->current_bar->status_padding); 19 config->current_bar->id, config->current_bar->status_padding);
20 return cmd_results_new(CMD_SUCCESS, NULL); 20 return cmd_results_new(CMD_SUCCESS, NULL);
21} 21}
diff --git a/sway/commands/bar/strip_workspace_name.c b/sway/commands/bar/strip_workspace_name.c
index b74afd6e..1aa39359 100644
--- a/sway/commands/bar/strip_workspace_name.c
+++ b/sway/commands/bar/strip_workspace_name.c
@@ -20,10 +20,10 @@ struct cmd_results *bar_cmd_strip_workspace_name(int argc, char **argv) {
20 if (config->current_bar->strip_workspace_name) { 20 if (config->current_bar->strip_workspace_name) {
21 config->current_bar->strip_workspace_numbers = false; 21 config->current_bar->strip_workspace_numbers = false;
22 22
23 wlr_log(WLR_DEBUG, "Stripping workspace name on bar: %s", 23 sway_log(SWAY_DEBUG, "Stripping workspace name on bar: %s",
24 config->current_bar->id); 24 config->current_bar->id);
25 } else { 25 } else {
26 wlr_log(WLR_DEBUG, "Enabling workspace name on bar: %s", 26 sway_log(SWAY_DEBUG, "Enabling workspace name on bar: %s",
27 config->current_bar->id); 27 config->current_bar->id);
28 } 28 }
29 29
diff --git a/sway/commands/bar/strip_workspace_numbers.c b/sway/commands/bar/strip_workspace_numbers.c
index 9c6ec228..56c4c4a1 100644
--- a/sway/commands/bar/strip_workspace_numbers.c
+++ b/sway/commands/bar/strip_workspace_numbers.c
@@ -20,10 +20,10 @@ struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) {
20 if (config->current_bar->strip_workspace_numbers) { 20 if (config->current_bar->strip_workspace_numbers) {
21 config->current_bar->strip_workspace_name = false; 21 config->current_bar->strip_workspace_name = false;
22 22
23 wlr_log(WLR_DEBUG, "Stripping workspace numbers on bar: %s", 23 sway_log(SWAY_DEBUG, "Stripping workspace numbers on bar: %s",
24 config->current_bar->id); 24 config->current_bar->id);
25 } else { 25 } else {
26 wlr_log(WLR_DEBUG, "Enabling workspace numbers on bar: %s", 26 sway_log(SWAY_DEBUG, "Enabling workspace numbers on bar: %s",
27 config->current_bar->id); 27 config->current_bar->id);
28 } 28 }
29 29
diff --git a/sway/commands/bar/swaybar_command.c b/sway/commands/bar/swaybar_command.c
index 6253e2b1..b54bafa9 100644
--- a/sway/commands/bar/swaybar_command.c
+++ b/sway/commands/bar/swaybar_command.c
@@ -13,7 +13,7 @@ struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) {
13 } 13 }
14 free(config->current_bar->swaybar_command); 14 free(config->current_bar->swaybar_command);
15 config->current_bar->swaybar_command = join_args(argv, argc); 15 config->current_bar->swaybar_command = join_args(argv, argc);
16 wlr_log(WLR_DEBUG, "Using custom swaybar command: %s", 16 sway_log(SWAY_DEBUG, "Using custom swaybar command: %s",
17 config->current_bar->swaybar_command); 17 config->current_bar->swaybar_command);
18 return cmd_results_new(CMD_SUCCESS, NULL); 18 return cmd_results_new(CMD_SUCCESS, NULL);
19} 19}
diff --git a/sway/commands/bar/tray_bind.c b/sway/commands/bar/tray_bind.c
index 48a15462..7fe67c42 100644
--- a/sway/commands/bar/tray_bind.c
+++ b/sway/commands/bar/tray_bind.c
@@ -67,7 +67,7 @@ static struct cmd_results *tray_bind(int argc, char **argv, bool code) {
67 other->command = binding->command; 67 other->command = binding->command;
68 free(binding); 68 free(binding);
69 binding = other; 69 binding = other;
70 wlr_log(WLR_DEBUG, 70 sway_log(SWAY_DEBUG,
71 "[bar %s] Updated tray binding for %u (%s) to %s", 71 "[bar %s] Updated tray binding for %u (%s) to %s",
72 config->current_bar->id, binding->button, name, 72 config->current_bar->id, binding->button, name,
73 binding->command); 73 binding->command);
@@ -76,7 +76,7 @@ static struct cmd_results *tray_bind(int argc, char **argv, bool code) {
76 } 76 }
77 if (!overwritten) { 77 if (!overwritten) {
78 wl_list_insert(&config->current_bar->tray_bindings, &binding->link); 78 wl_list_insert(&config->current_bar->tray_bindings, &binding->link);
79 wlr_log(WLR_DEBUG, "[bar %s] Added tray binding for %u (%s) to %s", 79 sway_log(SWAY_DEBUG, "[bar %s] Added tray binding for %u (%s) to %s",
80 config->current_bar->id, binding->button, name, 80 config->current_bar->id, binding->button, name,
81 binding->command); 81 binding->command);
82 } 82 }
diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c
index d45c09c6..16e16f60 100644
--- a/sway/commands/bar/tray_output.c
+++ b/sway/commands/bar/tray_output.c
@@ -23,13 +23,13 @@ struct cmd_results *bar_cmd_tray_output(int argc, char **argv) {
23 } 23 }
24 24
25 if (strcmp(argv[0], "none") == 0) { 25 if (strcmp(argv[0], "none") == 0) {
26 wlr_log(WLR_DEBUG, "Hiding tray on bar: %s", config->current_bar->id); 26 sway_log(SWAY_DEBUG, "Hiding tray on bar: %s", config->current_bar->id);
27 for (int i = 0; i < outputs->length; ++i) { 27 for (int i = 0; i < outputs->length; ++i) {
28 free(outputs->items[i]); 28 free(outputs->items[i]);
29 } 29 }
30 outputs->length = 0; 30 outputs->length = 0;
31 } else { 31 } else {
32 wlr_log(WLR_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], 32 sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0],
33 config->current_bar->id); 33 config->current_bar->id);
34 } 34 }
35 list_add(outputs, strdup(argv[0])); 35 list_add(outputs, strdup(argv[0]));
diff --git a/sway/commands/bar/tray_padding.c b/sway/commands/bar/tray_padding.c
index 1e8b294b..f43cfe4f 100644
--- a/sway/commands/bar/tray_padding.c
+++ b/sway/commands/bar/tray_padding.c
@@ -32,7 +32,7 @@ struct cmd_results *bar_cmd_tray_padding(int argc, char **argv) {
32 "Expected 'tray_padding <px> [px]'"); 32 "Expected 'tray_padding <px> [px]'");
33 } 33 }
34 34
35 wlr_log(WLR_DEBUG, "[Bar %s] Setting tray padding to %d", bar->id, padding); 35 sway_log(SWAY_DEBUG, "[Bar %s] Setting tray padding to %d", bar->id, padding);
36 config->current_bar->tray_padding = padding; 36 config->current_bar->tray_padding = padding;
37 return cmd_results_new(CMD_SUCCESS, NULL); 37 return cmd_results_new(CMD_SUCCESS, NULL);
38#else 38#else
diff --git a/sway/commands/bar/workspace_buttons.c b/sway/commands/bar/workspace_buttons.c
index 773e6357..792ef605 100644
--- a/sway/commands/bar/workspace_buttons.c
+++ b/sway/commands/bar/workspace_buttons.c
@@ -15,10 +15,10 @@ struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) {
15 config->current_bar->workspace_buttons = 15 config->current_bar->workspace_buttons =
16 parse_boolean(argv[0], config->current_bar->workspace_buttons); 16 parse_boolean(argv[0], config->current_bar->workspace_buttons);
17 if (config->current_bar->workspace_buttons) { 17 if (config->current_bar->workspace_buttons) {
18 wlr_log(WLR_DEBUG, "Enabling workspace buttons on bar: %s", 18 sway_log(SWAY_DEBUG, "Enabling workspace buttons on bar: %s",
19 config->current_bar->id); 19 config->current_bar->id);
20 } else { 20 } else {
21 wlr_log(WLR_DEBUG, "Disabling workspace buttons on bar: %s", 21 sway_log(SWAY_DEBUG, "Disabling workspace buttons on bar: %s",
22 config->current_bar->id); 22 config->current_bar->id);
23 } 23 }
24 return cmd_results_new(CMD_SUCCESS, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL);
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c
index 2f7bb090..decd238d 100644
--- a/sway/commands/bar/wrap_scroll.c
+++ b/sway/commands/bar/wrap_scroll.c
@@ -15,10 +15,10 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
15 config->current_bar->wrap_scroll = 15 config->current_bar->wrap_scroll =
16 parse_boolean(argv[0], config->current_bar->wrap_scroll); 16 parse_boolean(argv[0], config->current_bar->wrap_scroll);
17 if (config->current_bar->wrap_scroll) { 17 if (config->current_bar->wrap_scroll) {
18 wlr_log(WLR_DEBUG, "Enabling wrap scroll on bar: %s", 18 sway_log(SWAY_DEBUG, "Enabling wrap scroll on bar: %s",
19 config->current_bar->id); 19 config->current_bar->id);
20 } else { 20 } else {
21 wlr_log(WLR_DEBUG, "Disabling wrap scroll on bar: %s", 21 sway_log(SWAY_DEBUG, "Disabling wrap scroll on bar: %s",
22 config->current_bar->id); 22 config->current_bar->id);
23 } 23 }
24 return cmd_results_new(CMD_SUCCESS, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL);
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index b0493f7e..ce087fd0 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -291,7 +291,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
291 for (int i = 0; i < mode_bindings->length; ++i) { 291 for (int i = 0; i < mode_bindings->length; ++i) {
292 struct sway_binding *config_binding = mode_bindings->items[i]; 292 struct sway_binding *config_binding = mode_bindings->items[i];
293 if (binding_key_compare(binding, config_binding)) { 293 if (binding_key_compare(binding, config_binding)) {
294 wlr_log(WLR_INFO, "Overwriting binding '%s' for device '%s' " 294 sway_log(SWAY_INFO, "Overwriting binding '%s' for device '%s' "
295 "from `%s` to `%s`", argv[0], binding->input, 295 "from `%s` to `%s`", argv[0], binding->input,
296 binding->command, config_binding->command); 296 binding->command, config_binding->command);
297 if (warn) { 297 if (warn) {
@@ -310,7 +310,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
310 list_add(mode_bindings, binding); 310 list_add(mode_bindings, binding);
311 } 311 }
312 312
313 wlr_log(WLR_DEBUG, "%s - Bound %s to command `%s` for device '%s'", 313 sway_log(SWAY_DEBUG, "%s - Bound %s to command `%s` for device '%s'",
314 bindtype, argv[0], binding->command, binding->input); 314 bindtype, argv[0], binding->command, binding->input);
315 return cmd_results_new(CMD_SUCCESS, NULL); 315 return cmd_results_new(CMD_SUCCESS, NULL);
316} 316}
@@ -327,14 +327,14 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) {
327 * Execute the command associated to a binding 327 * Execute the command associated to a binding
328 */ 328 */
329void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) { 329void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) {
330 wlr_log(WLR_DEBUG, "running command for binding: %s", binding->command); 330 sway_log(SWAY_DEBUG, "running command for binding: %s", binding->command);
331 331
332 list_t *res_list = execute_command(binding->command, seat, NULL); 332 list_t *res_list = execute_command(binding->command, seat, NULL);
333 bool success = true; 333 bool success = true;
334 for (int i = 0; i < res_list->length; ++i) { 334 for (int i = 0; i < res_list->length; ++i) {
335 struct cmd_results *results = res_list->items[i]; 335 struct cmd_results *results = res_list->items[i];
336 if (results->status != CMD_SUCCESS) { 336 if (results->status != CMD_SUCCESS) {
337 wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)", 337 sway_log(SWAY_DEBUG, "could not run command for binding: %s (%s)",
338 binding->command, results->error); 338 binding->command, results->error);
339 success = false; 339 success = false;
340 } 340 }
diff --git a/sway/commands/client.c b/sway/commands/client.c
index 10bfa519..f5c7d90f 100644
--- a/sway/commands/client.c
+++ b/sway/commands/client.c
@@ -114,6 +114,6 @@ struct cmd_results *cmd_client_urgent(int argc, char **argv) {
114} 114}
115 115
116struct cmd_results *cmd_client_noop(int argc, char **argv) { 116struct cmd_results *cmd_client_noop(int argc, char **argv) {
117 wlr_log(WLR_INFO, "Warning: %s is ignored by sway", argv[-1]); 117 sway_log(SWAY_INFO, "Warning: %s is ignored by sway", argv[-1]);
118 return cmd_results_new(CMD_SUCCESS, NULL); 118 return cmd_results_new(CMD_SUCCESS, NULL);
119} 119}
diff --git a/sway/commands/exec.c b/sway/commands/exec.c
index dc8d8aac..87d90716 100644
--- a/sway/commands/exec.c
+++ b/sway/commands/exec.c
@@ -8,7 +8,7 @@ struct cmd_results *cmd_exec(int argc, char **argv) {
8 if (!config->active) return cmd_results_new(CMD_DEFER, NULL); 8 if (!config->active) return cmd_results_new(CMD_DEFER, NULL);
9 if (config->reloading) { 9 if (config->reloading) {
10 char *args = join_args(argv, argc); 10 char *args = join_args(argv, argc);
11 wlr_log(WLR_DEBUG, "Ignoring 'exec %s' due to reload", args); 11 sway_log(SWAY_DEBUG, "Ignoring 'exec %s' due to reload", args);
12 free(args); 12 free(args);
13 return cmd_results_new(CMD_SUCCESS, NULL); 13 return cmd_results_new(CMD_SUCCESS, NULL);
14 } 14 }
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 1ed6c7e6..a5724295 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -24,7 +24,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
24 24
25 char *tmp = NULL; 25 char *tmp = NULL;
26 if (strcmp(argv[0], "--no-startup-id") == 0) { 26 if (strcmp(argv[0], "--no-startup-id") == 0) {
27 wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored."); 27 sway_log(SWAY_INFO, "exec switch '--no-startup-id' not supported, ignored.");
28 --argc; ++argv; 28 --argc; ++argv;
29 if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { 29 if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) {
30 return error; 30 return error;
@@ -43,11 +43,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
43 strncpy(cmd, tmp, sizeof(cmd) - 1); 43 strncpy(cmd, tmp, sizeof(cmd) - 1);
44 cmd[sizeof(cmd) - 1] = 0; 44 cmd[sizeof(cmd) - 1] = 0;
45 free(tmp); 45 free(tmp);
46 wlr_log(WLR_DEBUG, "Executing %s", cmd); 46 sway_log(SWAY_DEBUG, "Executing %s", cmd);
47 47
48 int fd[2]; 48 int fd[2];
49 if (pipe(fd) != 0) { 49 if (pipe(fd) != 0) {
50 wlr_log(WLR_ERROR, "Unable to create pipe for fork"); 50 sway_log(SWAY_ERROR, "Unable to create pipe for fork");
51 } 51 }
52 52
53 pid_t pid, child; 53 pid_t pid, child;
@@ -84,7 +84,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
84 // cleanup child process 84 // cleanup child process
85 waitpid(pid, NULL, 0); 85 waitpid(pid, NULL, 0);
86 if (child > 0) { 86 if (child > 0) {
87 wlr_log(WLR_DEBUG, "Child process created with pid %d", child); 87 sway_log(SWAY_DEBUG, "Child process created with pid %d", child);
88 root_record_workspace_pid(child); 88 root_record_workspace_pid(child);
89 } else { 89 } else {
90 return cmd_results_new(CMD_FAILURE, "Second fork() failed"); 90 return cmd_results_new(CMD_FAILURE, "Second fork() failed");
diff --git a/sway/commands/floating_minmax_size.c b/sway/commands/floating_minmax_size.c
index 31c1e999..3a1d606a 100644
--- a/sway/commands/floating_minmax_size.c
+++ b/sway/commands/floating_minmax_size.c
@@ -4,7 +4,6 @@
4#include <stdlib.h> 4#include <stdlib.h>
5#include <string.h> 5#include <string.h>
6#include <strings.h> 6#include <strings.h>
7#include <wlr/util/log.h>
8#include "sway/commands.h" 7#include "sway/commands.h"
9#include "log.h" 8#include "log.h"
10 9
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 8564f3ff..e7680062 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -1,6 +1,5 @@
1#include <strings.h> 1#include <strings.h>
2#include <wlr/types/wlr_output_layout.h> 2#include <wlr/types/wlr_output_layout.h>
3#include <wlr/util/log.h>
4#include "log.h" 3#include "log.h"
5#include "sway/commands.h" 4#include "sway/commands.h"
6#include "sway/input/input-manager.h" 5#include "sway/input/input-manager.h"
diff --git a/sway/commands/for_window.c b/sway/commands/for_window.c
index f151575e..63cba099 100644
--- a/sway/commands/for_window.c
+++ b/sway/commands/for_window.c
@@ -23,7 +23,7 @@ struct cmd_results *cmd_for_window(int argc, char **argv) {
23 criteria->cmdlist = join_args(argv + 1, argc - 1); 23 criteria->cmdlist = join_args(argv + 1, argc - 1);
24 24
25 list_add(config->criteria, criteria); 25 list_add(config->criteria, criteria);
26 wlr_log(WLR_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist); 26 sway_log(SWAY_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist);
27 27
28 return cmd_results_new(CMD_SUCCESS, NULL); 28 return cmd_results_new(CMD_SUCCESS, NULL);
29} 29}
diff --git a/sway/commands/input.c b/sway/commands/input.c
index 1f77507a..b72bd76b 100644
--- a/sway/commands/input.c
+++ b/sway/commands/input.c
@@ -45,7 +45,7 @@ struct cmd_results *cmd_input(int argc, char **argv) {
45 return error; 45 return error;
46 } 46 }
47 47
48 wlr_log(WLR_DEBUG, "entering input block: %s", argv[0]); 48 sway_log(SWAY_DEBUG, "entering input block: %s", argv[0]);
49 49
50 config->handler_context.input_config = new_input_config(argv[0]); 50 config->handler_context.input_config = new_input_config(argv[0]);
51 if (!config->handler_context.input_config) { 51 if (!config->handler_context.input_config) {
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c
index c9200aa2..0879e2da 100644
--- a/sway/commands/input/xkb_layout.c
+++ b/sway/commands/input/xkb_layout.c
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
16 16
17 ic->xkb_layout = strdup(argv[0]); 17 ic->xkb_layout = strdup(argv[0]);
18 18
19 wlr_log(WLR_DEBUG, "set-xkb_layout for config: %s layout: %s", 19 sway_log(SWAY_DEBUG, "set-xkb_layout for config: %s layout: %s",
20 ic->identifier, ic->xkb_layout); 20 ic->identifier, ic->xkb_layout);
21 return cmd_results_new(CMD_SUCCESS, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL);
22} 22}
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c
index 763ae80e..9e384156 100644
--- a/sway/commands/input/xkb_model.c
+++ b/sway/commands/input/xkb_model.c
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
16 16
17 ic->xkb_model = strdup(argv[0]); 17 ic->xkb_model = strdup(argv[0]);
18 18
19 wlr_log(WLR_DEBUG, "set-xkb_model for config: %s model: %s", 19 sway_log(SWAY_DEBUG, "set-xkb_model for config: %s model: %s",
20 ic->identifier, ic->xkb_model); 20 ic->identifier, ic->xkb_model);
21 return cmd_results_new(CMD_SUCCESS, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL);
22} 22}
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
index 1ff6e680..8197dd1d 100644
--- a/sway/commands/input/xkb_options.c
+++ b/sway/commands/input/xkb_options.c
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
16 16
17 ic->xkb_options = strdup(argv[0]); 17 ic->xkb_options = strdup(argv[0]);
18 18
19 wlr_log(WLR_DEBUG, "set-xkb_options for config: %s options: %s", 19 sway_log(SWAY_DEBUG, "set-xkb_options for config: %s options: %s",
20 ic->identifier, ic->xkb_options); 20 ic->identifier, ic->xkb_options);
21 return cmd_results_new(CMD_SUCCESS, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL);
22} 22}
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c
index 29172b24..01ccd06f 100644
--- a/sway/commands/input/xkb_rules.c
+++ b/sway/commands/input/xkb_rules.c
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
16 16
17 ic->xkb_rules = strdup(argv[0]); 17 ic->xkb_rules = strdup(argv[0]);
18 18
19 wlr_log(WLR_DEBUG, "set-xkb_rules for config: %s rules: %s", 19 sway_log(SWAY_DEBUG, "set-xkb_rules for config: %s rules: %s",
20 ic->identifier, ic->xkb_rules); 20 ic->identifier, ic->xkb_rules);
21 return cmd_results_new(CMD_SUCCESS, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL);
22} 22}
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c
index 9f3baed6..37c82fbd 100644
--- a/sway/commands/input/xkb_variant.c
+++ b/sway/commands/input/xkb_variant.c
@@ -16,7 +16,7 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
16 16
17 ic->xkb_variant = strdup(argv[0]); 17 ic->xkb_variant = strdup(argv[0]);
18 18
19 wlr_log(WLR_DEBUG, "set-xkb_variant for config: %s variant: %s", 19 sway_log(SWAY_DEBUG, "set-xkb_variant for config: %s variant: %s",
20 ic->identifier, ic->xkb_variant); 20 ic->identifier, ic->xkb_variant);
21 return cmd_results_new(CMD_SUCCESS, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL);
22} 22}
diff --git a/sway/commands/kill.c b/sway/commands/kill.c
index 41daeb4e..f1e95e4b 100644
--- a/sway/commands/kill.c
+++ b/sway/commands/kill.c
@@ -1,4 +1,3 @@
1#include <wlr/util/log.h>
2#include "log.h" 1#include "log.h"
3#include "sway/input/input-manager.h" 2#include "sway/input/input-manager.h"
4#include "sway/input/seat.h" 3#include "sway/input/seat.h"
diff --git a/sway/commands/mode.c b/sway/commands/mode.c
index 828d77e1..d424eb1c 100644
--- a/sway/commands/mode.c
+++ b/sway/commands/mode.c
@@ -62,7 +62,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
62 return error; 62 return error;
63 } 63 }
64 if ((config->reading && argc > 1) || (!config->reading && argc == 1)) { 64 if ((config->reading && argc > 1) || (!config->reading && argc == 1)) {
65 wlr_log(WLR_DEBUG, "Switching to mode `%s' (pango=%d)", 65 sway_log(SWAY_DEBUG, "Switching to mode `%s' (pango=%d)",
66 mode->name, mode->pango); 66 mode->name, mode->pango);
67 } 67 }
68 // Set current mode 68 // Set current mode
diff --git a/sway/commands/move.c b/sway/commands/move.c
index d4b55922..b22bb056 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -6,7 +6,6 @@
6#include <wlr/types/wlr_cursor.h> 6#include <wlr/types/wlr_cursor.h>
7#include <wlr/types/wlr_output.h> 7#include <wlr/types/wlr_output.h>
8#include <wlr/types/wlr_output_layout.h> 8#include <wlr/types/wlr_output_layout.h>
9#include <wlr/util/log.h>
10#include "sway/commands.h" 9#include "sway/commands.h"
11#include "sway/input/cursor.h" 10#include "sway/input/cursor.h"
12#include "sway/input/seat.h" 11#include "sway/input/seat.h"
@@ -106,13 +105,13 @@ static void container_move_to_container_from_direction(
106 if (destination->view) { 105 if (destination->view) {
107 if (destination->parent == container->parent && 106 if (destination->parent == container->parent &&
108 destination->workspace == container->workspace) { 107 destination->workspace == container->workspace) {
109 wlr_log(WLR_DEBUG, "Swapping siblings"); 108 sway_log(SWAY_DEBUG, "Swapping siblings");
110 list_t *siblings = container_get_siblings(container); 109 list_t *siblings = container_get_siblings(container);
111 int container_index = list_find(siblings, container); 110 int container_index = list_find(siblings, container);
112 int destination_index = list_find(siblings, destination); 111 int destination_index = list_find(siblings, destination);
113 list_swap(siblings, container_index, destination_index); 112 list_swap(siblings, container_index, destination_index);
114 } else { 113 } else {
115 wlr_log(WLR_DEBUG, "Promoting to sibling of cousin"); 114 sway_log(SWAY_DEBUG, "Promoting to sibling of cousin");
116 int offset = 115 int offset =
117 move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP; 116 move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP;
118 int index = container_sibling_index(destination) + offset; 117 int index = container_sibling_index(destination) + offset;
@@ -128,7 +127,7 @@ static void container_move_to_container_from_direction(
128 } 127 }
129 128
130 if (is_parallel(destination->layout, move_dir)) { 129 if (is_parallel(destination->layout, move_dir)) {
131 wlr_log(WLR_DEBUG, "Reparenting container (parallel)"); 130 sway_log(SWAY_DEBUG, "Reparenting container (parallel)");
132 int index = 131 int index =
133 move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? 132 move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ?
134 0 : destination->children->length; 133 0 : destination->children->length;
@@ -137,7 +136,7 @@ static void container_move_to_container_from_direction(
137 return; 136 return;
138 } 137 }
139 138
140 wlr_log(WLR_DEBUG, "Reparenting container (perpendicular)"); 139 sway_log(SWAY_DEBUG, "Reparenting container (perpendicular)");
141 struct sway_node *focus_inactive = seat_get_active_tiling_child( 140 struct sway_node *focus_inactive = seat_get_active_tiling_child(
142 config->handler_context.seat, &destination->node); 141 config->handler_context.seat, &destination->node);
143 if (!focus_inactive || focus_inactive == &destination->node) { 142 if (!focus_inactive || focus_inactive == &destination->node) {
@@ -157,7 +156,7 @@ static void container_move_to_workspace_from_direction(
157 container->width = container->height = 0; 156 container->width = container->height = 0;
158 157
159 if (is_parallel(workspace->layout, move_dir)) { 158 if (is_parallel(workspace->layout, move_dir)) {
160 wlr_log(WLR_DEBUG, "Reparenting container (parallel)"); 159 sway_log(SWAY_DEBUG, "Reparenting container (parallel)");
161 int index = 160 int index =
162 move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? 161 move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ?
163 0 : workspace->tiling->length; 162 0 : workspace->tiling->length;
@@ -165,7 +164,7 @@ static void container_move_to_workspace_from_direction(
165 return; 164 return;
166 } 165 }
167 166
168 wlr_log(WLR_DEBUG, "Reparenting container (perpendicular)"); 167 sway_log(SWAY_DEBUG, "Reparenting container (perpendicular)");
169 struct sway_container *focus_inactive = seat_get_focus_inactive_tiling( 168 struct sway_container *focus_inactive = seat_get_focus_inactive_tiling(
170 config->handler_context.seat, workspace); 169 config->handler_context.seat, workspace);
171 if (!focus_inactive) { 170 if (!focus_inactive) {
@@ -362,7 +361,7 @@ static bool container_move_in_direction(struct sway_container *container,
362 container_move_to_workspace_from_direction(container, ws, move_dir); 361 container_move_to_workspace_from_direction(container, ws, move_dir);
363 return true; 362 return true;
364 } 363 }
365 wlr_log(WLR_DEBUG, "Hit edge of output, nowhere else to go"); 364 sway_log(SWAY_DEBUG, "Hit edge of output, nowhere else to go");
366 return false; 365 return false;
367} 366}
368 367
diff --git a/sway/commands/output.c b/sway/commands/output.c
index 73dbb723..74ca9d0b 100644
--- a/sway/commands/output.c
+++ b/sway/commands/output.c
@@ -28,7 +28,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
28 28
29 struct output_config *output = new_output_config(argv[0]); 29 struct output_config *output = new_output_config(argv[0]);
30 if (!output) { 30 if (!output) {
31 wlr_log(WLR_ERROR, "Failed to allocate output config"); 31 sway_log(SWAY_ERROR, "Failed to allocate output config");
32 return NULL; 32 return NULL;
33 } 33 }
34 argc--; argv++; 34 argc--; argv++;
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index 00038e67..affa04ea 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -79,7 +79,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
79 src = join_args(p.we_wordv, p.we_wordc); 79 src = join_args(p.we_wordv, p.we_wordc);
80 wordfree(&p); 80 wordfree(&p);
81 if (!src) { 81 if (!src) {
82 wlr_log(WLR_ERROR, "Failed to duplicate string"); 82 sway_log(SWAY_ERROR, "Failed to duplicate string");
83 return cmd_results_new(CMD_FAILURE, "Unable to allocate resource"); 83 return cmd_results_new(CMD_FAILURE, "Unable to allocate resource");
84 } 84 }
85 85
@@ -88,7 +88,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
88 88
89 char *conf = strdup(config->current_config_path); 89 char *conf = strdup(config->current_config_path);
90 if (!conf) { 90 if (!conf) {
91 wlr_log(WLR_ERROR, "Failed to duplicate string"); 91 sway_log(SWAY_ERROR, "Failed to duplicate string");
92 free(src); 92 free(src);
93 return cmd_results_new(CMD_FAILURE, 93 return cmd_results_new(CMD_FAILURE,
94 "Unable to allocate resources"); 94 "Unable to allocate resources");
@@ -100,7 +100,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
100 if (!src) { 100 if (!src) {
101 free(rel_path); 101 free(rel_path);
102 free(conf); 102 free(conf);
103 wlr_log(WLR_ERROR, "Unable to allocate memory"); 103 sway_log(SWAY_ERROR, "Unable to allocate memory");
104 return cmd_results_new(CMD_FAILURE, 104 return cmd_results_new(CMD_FAILURE,
105 "Unable to allocate resources"); 105 "Unable to allocate resources");
106 } 106 }
@@ -112,7 +112,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
112 112
113 bool can_access = access(src, F_OK) != -1; 113 bool can_access = access(src, F_OK) != -1;
114 if (!can_access) { 114 if (!can_access) {
115 wlr_log(WLR_ERROR, "Unable to access background file '%s': %s", 115 sway_log(SWAY_ERROR, "Unable to access background file '%s': %s",
116 src, strerror(errno)); 116 src, strerror(errno));
117 config_add_swaynag_warning("Unable to access background file '%s'", 117 config_add_swaynag_warning("Unable to access background file '%s'",
118 src); 118 src);
diff --git a/sway/commands/reload.c b/sway/commands/reload.c
index 6e7772e9..19ec065c 100644
--- a/sway/commands/reload.c
+++ b/sway/commands/reload.c
@@ -23,7 +23,7 @@ static void do_reload(void *data) {
23 } 23 }
24 24
25 if (!load_main_config(config->current_config_path, true, false)) { 25 if (!load_main_config(config->current_config_path, true, false)) {
26 wlr_log(WLR_ERROR, "Error(s) reloading config"); 26 sway_log(SWAY_ERROR, "Error(s) reloading config");
27 list_free_items_and_destroy(bar_ids); 27 list_free_items_and_destroy(bar_ids);
28 return; 28 return;
29 } 29 }
diff --git a/sway/commands/rename.c b/sway/commands/rename.c
index a68302c4..88377b09 100644
--- a/sway/commands/rename.c
+++ b/sway/commands/rename.c
@@ -88,7 +88,7 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
88 } 88 }
89 } 89 }
90 90
91 wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name); 91 sway_log(SWAY_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
92 free(workspace->name); 92 free(workspace->name);
93 workspace->name = new_name; 93 workspace->name = new_name;
94 94
diff --git a/sway/commands/resize.c b/sway/commands/resize.c
index c88d2734..0e497239 100644
--- a/sway/commands/resize.c
+++ b/sway/commands/resize.c
@@ -6,7 +6,6 @@
6#include <string.h> 6#include <string.h>
7#include <strings.h> 7#include <strings.h>
8#include <wlr/util/edges.h> 8#include <wlr/util/edges.h>
9#include <wlr/util/log.h>
10#include "sway/commands.h" 9#include "sway/commands.h"
11#include "sway/tree/arrange.h" 10#include "sway/tree/arrange.h"
12#include "sway/tree/view.h" 11#include "sway/tree/view.h"
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c
index 1162d51f..805dbc0b 100644
--- a/sway/commands/scratchpad.c
+++ b/sway/commands/scratchpad.c
@@ -23,7 +23,7 @@ static void scratchpad_toggle_auto(void) {
23 // Check if the currently focused window is a scratchpad window and should 23 // Check if the currently focused window is a scratchpad window and should
24 // be hidden again. 24 // be hidden again.
25 if (focus && focus->scratchpad) { 25 if (focus && focus->scratchpad) {
26 wlr_log(WLR_DEBUG, "Focus is a scratchpad window - hiding %s", 26 sway_log(SWAY_DEBUG, "Focus is a scratchpad window - hiding %s",
27 focus->title); 27 focus->title);
28 root_scratchpad_hide(focus); 28 root_scratchpad_hide(focus);
29 return; 29 return;
@@ -34,7 +34,7 @@ static void scratchpad_toggle_auto(void) {
34 for (int i = 0; i < ws->floating->length; ++i) { 34 for (int i = 0; i < ws->floating->length; ++i) {
35 struct sway_container *floater = ws->floating->items[i]; 35 struct sway_container *floater = ws->floating->items[i];
36 if (floater->scratchpad && focus != floater) { 36 if (floater->scratchpad && focus != floater) {
37 wlr_log(WLR_DEBUG, 37 sway_log(SWAY_DEBUG,
38 "Focusing other scratchpad window (%s) in this workspace", 38 "Focusing other scratchpad window (%s) in this workspace",
39 floater->title); 39 floater->title);
40 root_scratchpad_show(floater); 40 root_scratchpad_show(floater);
@@ -47,7 +47,7 @@ static void scratchpad_toggle_auto(void) {
47 for (int i = 0; i < root->scratchpad->length; ++i) { 47 for (int i = 0; i < root->scratchpad->length; ++i) {
48 struct sway_container *con = root->scratchpad->items[i]; 48 struct sway_container *con = root->scratchpad->items[i];
49 if (con->parent) { 49 if (con->parent) {
50 wlr_log(WLR_DEBUG, 50 sway_log(SWAY_DEBUG,
51 "Moving a visible scratchpad window (%s) to this workspace", 51 "Moving a visible scratchpad window (%s) to this workspace",
52 con->title); 52 con->title);
53 root_scratchpad_show(con); 53 root_scratchpad_show(con);
@@ -60,7 +60,7 @@ static void scratchpad_toggle_auto(void) {
60 return; 60 return;
61 } 61 }
62 struct sway_container *con = root->scratchpad->items[0]; 62 struct sway_container *con = root->scratchpad->items[0];
63 wlr_log(WLR_DEBUG, "Showing %s from list", con->title); 63 sway_log(SWAY_DEBUG, "Showing %s from list", con->title);
64 root_scratchpad_show(con); 64 root_scratchpad_show(con);
65} 65}
66 66
diff --git a/sway/commands/swap.c b/sway/commands/swap.c
index a8beb162..0d8d1116 100644
--- a/sway/commands/swap.c
+++ b/sway/commands/swap.c
@@ -1,6 +1,5 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <strings.h> 2#include <strings.h>
3#include <wlr/util/log.h>
4#include "config.h" 3#include "config.h"
5#include "log.h" 4#include "log.h"
6#include "sway/commands.h" 5#include "sway/commands.h"
@@ -96,7 +95,7 @@ static void container_swap(struct sway_container *con1,
96 return; 95 return;
97 } 96 }
98 97
99 wlr_log(WLR_DEBUG, "Swapping containers %zu and %zu", 98 sway_log(SWAY_DEBUG, "Swapping containers %zu and %zu",
100 con1->node.id, con2->node.id); 99 con1->node.id, con2->node.id);
101 100
102 bool fs1 = con1->is_fullscreen; 101 bool fs1 = con1->is_fullscreen;
diff --git a/sway/commands/swaybg_command.c b/sway/commands/swaybg_command.c
index 91294bf4..92e9bdfd 100644
--- a/sway/commands/swaybg_command.c
+++ b/sway/commands/swaybg_command.c
@@ -15,7 +15,7 @@ struct cmd_results *cmd_swaybg_command(int argc, char **argv) {
15 char *new_command = join_args(argv, argc); 15 char *new_command = join_args(argv, argc);
16 if (strcmp(new_command, "-") != 0) { 16 if (strcmp(new_command, "-") != 0) {
17 config->swaybg_command = new_command; 17 config->swaybg_command = new_command;
18 wlr_log(WLR_DEBUG, "Using custom swaybg command: %s", 18 sway_log(SWAY_DEBUG, "Using custom swaybg command: %s",
19 config->swaybg_command); 19 config->swaybg_command);
20 } else { 20 } else {
21 free(new_command); 21 free(new_command);
diff --git a/sway/commands/swaynag_command.c b/sway/commands/swaynag_command.c
index b420f311..f851d223 100644
--- a/sway/commands/swaynag_command.c
+++ b/sway/commands/swaynag_command.c
@@ -15,7 +15,7 @@ struct cmd_results *cmd_swaynag_command(int argc, char **argv) {
15 char *new_command = join_args(argv, argc); 15 char *new_command = join_args(argv, argc);
16 if (strcmp(new_command, "-") != 0) { 16 if (strcmp(new_command, "-") != 0) {
17 config->swaynag_command = new_command; 17 config->swaynag_command = new_command;
18 wlr_log(WLR_DEBUG, "Using custom swaynag command: %s", 18 sway_log(SWAY_DEBUG, "Using custom swaynag command: %s",
19 config->swaynag_command); 19 config->swaynag_command);
20 } else { 20 } else {
21 free(new_command); 21 free(new_command);
diff --git a/sway/commands/xwayland.c b/sway/commands/xwayland.c
index c3f73f67..b72f3239 100644
--- a/sway/commands/xwayland.c
+++ b/sway/commands/xwayland.c
@@ -13,7 +13,7 @@ struct cmd_results *cmd_xwayland(int argc, char **argv) {
13#ifdef HAVE_XWAYLAND 13#ifdef HAVE_XWAYLAND
14 config->xwayland = parse_boolean(argv[0], config->xwayland); 14 config->xwayland = parse_boolean(argv[0], config->xwayland);
15#else 15#else
16 wlr_log(WLR_INFO, "Ignoring `xwayland` command, " 16 sway_log(SWAY_INFO, "Ignoring `xwayland` command, "
17 "sway hasn't been built with Xwayland support"); 17 "sway hasn't been built with Xwayland support");
18#endif 18#endif
19 19