summaryrefslogtreecommitdiff
path: root/swaynag/main.c
diff options
context:
space:
mode:
authorM Stoeckl <[email protected]>2019-01-20 13:51:12 -0500
committeremersion <[email protected]>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /swaynag/main.c
parent5c834d36e14aaeca4ac1d22b869254d5722af4af (diff)
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) {
exit_code = launch_status;
goto cleanup;
}
- wlr_log_init(debug ? WLR_DEBUG : WLR_ERROR, NULL);
+ sway_log_init(debug ? SWAY_DEBUG : SWAY_ERROR, NULL);
if (!config_path) {
config_path = swaynag_get_config_path();
}
if (config_path) {
- wlr_log(WLR_DEBUG, "Loading config file: %s", config_path);
+ sway_log(SWAY_DEBUG, "Loading config file: %s", config_path);
int config_status = swaynag_load_config(config_path, &swaynag, types);
free(config_path);
if (config_status != 0) {
@@ -77,7 +77,7 @@ int main(int argc, char **argv) {
}
if (!swaynag.message) {
- wlr_log(WLR_ERROR, "No message passed. Please provide --message/-m");
+ sway_log(SWAY_ERROR, "No message passed. Please provide --message/-m");
exit_code = EXIT_FAILURE;
goto cleanup;
}
@@ -106,15 +106,15 @@ int main(int argc, char **argv) {
free(swaynag.details.button_details);
}
- wlr_log(WLR_DEBUG, "Output: %s", swaynag.type->output);
- wlr_log(WLR_DEBUG, "Anchors: %d", swaynag.type->anchors);
- wlr_log(WLR_DEBUG, "Type: %s", swaynag.type->name);
- wlr_log(WLR_DEBUG, "Message: %s", swaynag.message);
- wlr_log(WLR_DEBUG, "Font: %s", swaynag.type->font);
- wlr_log(WLR_DEBUG, "Buttons");
+ sway_log(SWAY_DEBUG, "Output: %s", swaynag.type->output);
+ sway_log(SWAY_DEBUG, "Anchors: %d", swaynag.type->anchors);
+ sway_log(SWAY_DEBUG, "Type: %s", swaynag.type->name);
+ sway_log(SWAY_DEBUG, "Message: %s", swaynag.message);
+ sway_log(SWAY_DEBUG, "Font: %s", swaynag.type->font);
+ sway_log(SWAY_DEBUG, "Buttons");
for (int i = 0; i < swaynag.buttons->length; i++) {
struct swaynag_button *button = swaynag.buttons->items[i];
- wlr_log(WLR_DEBUG, "\t[%s] `%s`", button->text, button->action);
+ sway_log(SWAY_DEBUG, "\t[%s] `%s`", button->text, button->action);
}
signal(SIGTERM, sig_handler);