aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output
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/output
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/output')
-rw-r--r--sway/commands/output/background.c8
1 files changed, 4 insertions, 4 deletions
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);