summaryrefslogtreecommitdiff
path: root/background-image.c
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-01-14 23:30:54 -0500
committerBrian Ashworth <bosrsf04@gmail.com>2019-01-14 23:30:54 -0500
commite3935ad1431623b5e3966e95cd75b45e7e00e278 (patch)
tree01a33b3422b9d17ad3b63fb4decb972876210f88 /background-image.c
parentfcf1bd4ebea97ae6ecd30e4f4e0c526b405b871a (diff)
Implement logging and remove wlroots dependency
This implements a simpler version of the wlroots logger for swaylock. With this logger, the dependency on wlroots can be dropped. This also adds a debug flag and disables debugging output by default
Diffstat (limited to 'background-image.c')
-rw-r--r--background-image.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/background-image.c b/background-image.c
index 72f39a7..d2ab03b 100644
--- a/background-image.c
+++ b/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);
+ swaylock_log(LOG_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).",
+ swaylock_log(LOG_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.");
+ swaylock_log(LOG_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."
+ swaylock_log(LOG_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."