aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/main.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 /swaynag/main.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 'swaynag/main.c')
-rw-r--r--swaynag/main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/swaynag/main.c b/swaynag/main.c
index 9f00ac7e..4a785f40 100644
--- a/swaynag/main.c
+++ b/swaynag/main.c
@@ -47,13 +47,13 @@ int main(int argc, char **argv) {
47 exit_code = launch_status; 47 exit_code = launch_status;
48 goto cleanup; 48 goto cleanup;
49 } 49 }
50 wlr_log_init(debug ? WLR_DEBUG : WLR_ERROR, NULL); 50 sway_log_init(debug ? SWAY_DEBUG : SWAY_ERROR, NULL);
51 51
52 if (!config_path) { 52 if (!config_path) {
53 config_path = swaynag_get_config_path(); 53 config_path = swaynag_get_config_path();
54 } 54 }
55 if (config_path) { 55 if (config_path) {
56 wlr_log(WLR_DEBUG, "Loading config file: %s", config_path); 56 sway_log(SWAY_DEBUG, "Loading config file: %s", config_path);
57 int config_status = swaynag_load_config(config_path, &swaynag, types); 57 int config_status = swaynag_load_config(config_path, &swaynag, types);
58 free(config_path); 58 free(config_path);
59 if (config_status != 0) { 59 if (config_status != 0) {
@@ -77,7 +77,7 @@ int main(int argc, char **argv) {
77 } 77 }
78 78
79 if (!swaynag.message) { 79 if (!swaynag.message) {
80 wlr_log(WLR_ERROR, "No message passed. Please provide --message/-m"); 80 sway_log(SWAY_ERROR, "No message passed. Please provide --message/-m");
81 exit_code = EXIT_FAILURE; 81 exit_code = EXIT_FAILURE;
82 goto cleanup; 82 goto cleanup;
83 } 83 }
@@ -106,15 +106,15 @@ int main(int argc, char **argv) {
106 free(swaynag.details.button_details); 106 free(swaynag.details.button_details);
107 } 107 }
108 108
109 wlr_log(WLR_DEBUG, "Output: %s", swaynag.type->output); 109 sway_log(SWAY_DEBUG, "Output: %s", swaynag.type->output);
110 wlr_log(WLR_DEBUG, "Anchors: %d", swaynag.type->anchors); 110 sway_log(SWAY_DEBUG, "Anchors: %d", swaynag.type->anchors);
111 wlr_log(WLR_DEBUG, "Type: %s", swaynag.type->name); 111 sway_log(SWAY_DEBUG, "Type: %s", swaynag.type->name);
112 wlr_log(WLR_DEBUG, "Message: %s", swaynag.message); 112 sway_log(SWAY_DEBUG, "Message: %s", swaynag.message);
113 wlr_log(WLR_DEBUG, "Font: %s", swaynag.type->font); 113 sway_log(SWAY_DEBUG, "Font: %s", swaynag.type->font);
114 wlr_log(WLR_DEBUG, "Buttons"); 114 sway_log(SWAY_DEBUG, "Buttons");
115 for (int i = 0; i < swaynag.buttons->length; i++) { 115 for (int i = 0; i < swaynag.buttons->length; i++) {
116 struct swaynag_button *button = swaynag.buttons->items[i]; 116 struct swaynag_button *button = swaynag.buttons->items[i];
117 wlr_log(WLR_DEBUG, "\t[%s] `%s`", button->text, button->action); 117 sway_log(SWAY_DEBUG, "\t[%s] `%s`", button->text, button->action);
118 } 118 }
119 119
120 signal(SIGTERM, sig_handler); 120 signal(SIGTERM, sig_handler);