From f736198c315bb91bfa7faff095181a3e8e89df94 Mon Sep 17 00:00:00 2001 From: Mykyta Holubakha Date: Thu, 11 May 2017 19:29:10 +0300 Subject: [PATCH] Initialise logging earlier --- sway/main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sway/main.c b/sway/main.c index b9549b12..3d2d6c68 100644 --- a/sway/main.c +++ b/sway/main.c @@ -288,6 +288,15 @@ int main(int argc, char **argv) { } } + // we need to setup logging before wlc_init in case it fails. + if (debug) { + init_log(L_DEBUG); + } else if (verbose || validate) { + init_log(L_INFO); + } else { + init_log(L_ERROR); + } + if (optind < argc) { // Behave as IPC client if(optind != 1) { sway_log(L_ERROR, "Don't use options with the IPC client"); @@ -329,14 +338,6 @@ int main(int argc, char **argv) { } #endif - // we need to setup logging before wlc_init in case it fails. - if (debug) { - init_log(L_DEBUG); - } else if (verbose || validate) { - init_log(L_INFO); - } else { - init_log(L_ERROR); - } wlc_log_set_handler(wlc_log_handler); log_kernel(); log_distro();