aboutsummaryrefslogtreecommitdiff
path: root/swaybg
diff options
context:
space:
mode:
authorM Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committeremersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /swaybg
parent5c834d36e14aaeca4ac1d22b869254d5722af4af (diff)
downloadsway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.xz
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 'swaybg')
-rw-r--r--swaybg/main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/swaybg/main.c b/swaybg/main.c
index 5678a671..e66221f0 100644
--- a/swaybg/main.c
+++ b/swaybg/main.c
@@ -6,9 +6,9 @@
#include <string.h>
#include <time.h>
#include <wayland-client.h>
-#include <wlr/util/log.h>
#include "background-image.h"
#include "cairo.h"
+#include "log.h"
#include "pool-buffer.h"
#include "util.h"
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
@@ -62,7 +62,7 @@ struct swaybg_state {
bool is_valid_color(const char *color) {
int len = strlen(color);
if (len != 7 || color[0] != '#') {
- wlr_log(WLR_ERROR, "%s is not a valid color for swaybg. "
+ sway_log(SWAY_ERROR, "%s is not a valid color for swaybg. "
"Color should be specified as #rrggbb (no alpha).", color);
return false;
}
@@ -253,14 +253,14 @@ static const struct wl_registry_listener registry_listener = {
};
int main(int argc, const char **argv) {
- wlr_log_init(WLR_DEBUG, NULL);
+ sway_log_init(SWAY_DEBUG, NULL);
struct swaybg_args args = {0};
struct swaybg_state state = { .args = &args };
wl_list_init(&state.outputs);
if (argc < 4 || argc > 5) {
- wlr_log(WLR_ERROR, "Do not run this program manually. "
+ sway_log(SWAY_ERROR, "Do not run this program manually. "
"See `man 5 sway-output` and look for background options.");
return 1;
}
@@ -281,7 +281,7 @@ int main(int argc, const char **argv) {
state.display = wl_display_connect(NULL);
if (!state.display) {
- wlr_log(WLR_ERROR, "Unable to connect to the compositor. "
+ sway_log(SWAY_ERROR, "Unable to connect to the compositor. "
"If your compositor is running, check or set the "
"WAYLAND_DISPLAY environment variable.");
return 1;
@@ -292,7 +292,7 @@ int main(int argc, const char **argv) {
wl_display_roundtrip(state.display);
if (state.compositor == NULL || state.shm == NULL ||
state.layer_shell == NULL || state.xdg_output_manager == NULL) {
- wlr_log(WLR_ERROR, "Missing a required Wayland interface");
+ sway_log(SWAY_ERROR, "Missing a required Wayland interface");
return 1;
}
@@ -306,7 +306,7 @@ int main(int argc, const char **argv) {
// Second roundtrip to get xdg_output properties
wl_display_roundtrip(state.display);
if (state.output == NULL) {
- wlr_log(WLR_ERROR, "Cannot find output '%s'", args.output);
+ sway_log(SWAY_ERROR, "Cannot find output '%s'", args.output);
return 1;
}