diff options
author | M Stoeckl <[email protected]> | 2019-01-20 13:51:12 -0500 |
---|---|---|
committer | emersion <[email protected]> | 2019-01-21 12:59:42 +0100 |
commit | 1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch) | |
tree | 5c3f60e0219cb8b4a1b7cafb760a871661866e32 /common/background-image.c | |
parent | 5c834d36e14aaeca4ac1d22b869254d5722af4af (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 'common/background-image.c')
-rw-r--r-- | common/background-image.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/background-image.c b/common/background-image.c index 72f39a79..d15c2989 100644 --- a/common/background-image.c +++ b/common/background-image.c @@ -1,8 +1,8 @@ #include <assert.h> #include <stdbool.h> -#include <wlr/util/log.h> #include "background-image.h" #include "cairo.h" +#include "log.h" enum background_mode parse_background_mode(const char *mode) { if (strcmp(mode, "stretch") == 0) { @@ -18,7 +18,7 @@ enum background_mode parse_background_mode(const char *mode) { } else if (strcmp(mode, "solid_color") == 0) { return BACKGROUND_MODE_SOLID_COLOR; } - wlr_log(WLR_ERROR, "Unsupported background mode: %s", mode); + sway_log(SWAY_ERROR, "Unsupported background mode: %s", mode); return BACKGROUND_MODE_INVALID; } @@ -28,7 +28,7 @@ cairo_surface_t *load_background_image(const char *path) { GError *err = NULL; GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, &err); if (!pixbuf) { - wlr_log(WLR_ERROR, "Failed to load background image (%s).", + sway_log(SWAY_ERROR, "Failed to load background image (%s).", err->message); return false; } @@ -38,11 +38,11 @@ cairo_surface_t *load_background_image(const char *path) { image = cairo_image_surface_create_from_png(path); #endif // HAVE_GDK_PIXBUF if (!image) { - wlr_log(WLR_ERROR, "Failed to read background image."); + sway_log(SWAY_ERROR, "Failed to read background image."); return NULL; } if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) { - wlr_log(WLR_ERROR, "Failed to read background image: %s." + sway_log(SWAY_ERROR, "Failed to read background image: %s." #if !HAVE_GDK_PIXBUF "\nSway was compiled without gdk_pixbuf support, so only" "\nPNG images can be loaded. This is the likely cause." |