diff options
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c index ffbcdbdf..3f2fcd94 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -21,6 +21,16 @@ void sway_terminate(void) { | |||
21 | 21 | ||
22 | static void sigchld_handle(int signal); | 22 | static void sigchld_handle(int signal); |
23 | 23 | ||
24 | static void wlc_log_handler(enum wlc_log_type type, const char *str) { | ||
25 | if (type == WLC_LOG_ERROR) { | ||
26 | sway_log(L_ERROR, "[wlc] %s", str); | ||
27 | } else if (type == WLC_LOG_WARN) { | ||
28 | sway_log(L_INFO, "[wlc] %s", str); | ||
29 | } else { | ||
30 | sway_log(L_DEBUG, "[wlc] %s", str); | ||
31 | } | ||
32 | } | ||
33 | |||
24 | int main(int argc, char **argv) { | 34 | int main(int argc, char **argv) { |
25 | static int verbose = 0, debug = 0, validate = 0; | 35 | static int verbose = 0, debug = 0, validate = 0; |
26 | 36 | ||
@@ -38,6 +48,8 @@ int main(int argc, char **argv) { | |||
38 | 48 | ||
39 | setenv("WLC_DIM", "0", 0); | 49 | setenv("WLC_DIM", "0", 0); |
40 | 50 | ||
51 | wlc_log_set_handler(wlc_log_handler); | ||
52 | |||
41 | /* Changing code earlier than this point requires detailed review */ | 53 | /* Changing code earlier than this point requires detailed review */ |
42 | if (!wlc_init(&interface, argc, argv)) { | 54 | if (!wlc_init(&interface, argc, argv)) { |
43 | return 1; | 55 | return 1; |