aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Mykyta Holubakha <hilobakho@gmail.com>2017-05-11 19:29:10 +0300
committerLibravatar Mykyta Holubakha <hilobakho@gmail.com>2017-05-11 19:29:25 +0300
commitf736198c315bb91bfa7faff095181a3e8e89df94 (patch)
treed5a2882b71de1f393eb29133196a8283c564087a
parentMerge pull request #1211 from wdbw/missing-send-event (diff)
downloadsway-f736198c315bb91bfa7faff095181a3e8e89df94.tar.gz
sway-f736198c315bb91bfa7faff095181a3e8e89df94.tar.zst
sway-f736198c315bb91bfa7faff095181a3e8e89df94.zip
Initialise logging earlier
-rw-r--r--sway/main.c17
1 files 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) {
288 } 288 }
289 } 289 }
290 290
291 // we need to setup logging before wlc_init in case it fails.
292 if (debug) {
293 init_log(L_DEBUG);
294 } else if (verbose || validate) {
295 init_log(L_INFO);
296 } else {
297 init_log(L_ERROR);
298 }
299
291 if (optind < argc) { // Behave as IPC client 300 if (optind < argc) { // Behave as IPC client
292 if(optind != 1) { 301 if(optind != 1) {
293 sway_log(L_ERROR, "Don't use options with the IPC client"); 302 sway_log(L_ERROR, "Don't use options with the IPC client");
@@ -329,14 +338,6 @@ int main(int argc, char **argv) {
329 } 338 }
330#endif 339#endif
331 340
332 // we need to setup logging before wlc_init in case it fails.
333 if (debug) {
334 init_log(L_DEBUG);
335 } else if (verbose || validate) {
336 init_log(L_INFO);
337 } else {
338 init_log(L_ERROR);
339 }
340 wlc_log_set_handler(wlc_log_handler); 341 wlc_log_set_handler(wlc_log_handler);
341 log_kernel(); 342 log_kernel();
342 log_distro(); 343 log_distro();