aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-23 13:08:04 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-23 13:08:04 -0400
commitac2034df99e1ec19e8bca60a802cd9f9d8fbbf83 (patch)
treef082445bccda0c8d4d6daf7be5534062cc634964 /sway
parent1e18ba9f2d170c89c4cf202a9dfd7b87da4fa769 (diff)
Handle wlc log events
Diffstat (limited to 'sway')
-rw-r--r--sway/handlers.c1
-rw-r--r--sway/main.c12
2 files changed, 12 insertions, 1 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index cb42196f..e4018811 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -498,7 +498,6 @@ static void handle_wlc_ready(void) {
config->active = true;
}
-
struct wlc_interface interface = {
.output = {
.created = handle_output_created,
diff --git a/sway/main.c b/sway/main.c
index ffbcdbdf..f8959009 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -21,6 +21,16 @@ void sway_terminate(void) {
static void sigchld_handle(int signal);
+static void wlc_log_handler(enum wlc_log_type type, const char *str) {
+ if (type == WLC_LOG_ERROR) {
+ sway_log(L_ERROR, "%s", str);
+ } else if (type == WLC_LOG_WARN) {
+ sway_log(L_INFO, "%s", str);
+ } else {
+ sway_log(L_DEBUG, "%s", str);
+ }
+}
+
int main(int argc, char **argv) {
static int verbose = 0, debug = 0, validate = 0;
@@ -38,6 +48,8 @@ int main(int argc, char **argv) {
setenv("WLC_DIM", "0", 0);
+ wlc_log_set_handler(wlc_log_handler);
+
/* Changing code earlier than this point requires detailed review */
if (!wlc_init(&interface, argc, argv)) {
return 1;