diff options
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/main.c b/sway/main.c index dd609214..1a4087d3 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -107,6 +107,14 @@ int main(int argc, char **argv) { | |||
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | // we need to setup logging before wlc_init in case it fails. | ||
111 | if (debug) { | ||
112 | init_log(L_DEBUG); | ||
113 | } else if (verbose || validate) { | ||
114 | init_log(L_INFO); | ||
115 | } else { | ||
116 | init_log(L_ERROR); | ||
117 | } | ||
110 | setenv("WLC_DIM", "0", 0); | 118 | setenv("WLC_DIM", "0", 0); |
111 | wlc_log_set_handler(wlc_log_handler); | 119 | wlc_log_set_handler(wlc_log_handler); |
112 | detect_nvidia(); | 120 | detect_nvidia(); |
@@ -119,14 +127,6 @@ int main(int argc, char **argv) { | |||
119 | } | 127 | } |
120 | register_extensions(); | 128 | register_extensions(); |
121 | 129 | ||
122 | if (debug) { | ||
123 | init_log(L_DEBUG); | ||
124 | } else if (verbose || validate) { | ||
125 | init_log(L_INFO); | ||
126 | } else { | ||
127 | init_log(L_ERROR); | ||
128 | } | ||
129 | |||
130 | #if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE | 130 | #if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE |
131 | sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); | 131 | sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); |
132 | #endif | 132 | #endif |