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 1261a7ce..c7696e2e 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -126,6 +126,14 @@ int main(int argc, char **argv) { | |||
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | // we need to setup logging before wlc_init in case it fails. | ||
130 | if (debug) { | ||
131 | init_log(L_DEBUG); | ||
132 | } else if (verbose || validate) { | ||
133 | init_log(L_INFO); | ||
134 | } else { | ||
135 | init_log(L_ERROR); | ||
136 | } | ||
129 | setenv("WLC_DIM", "0", 0); | 137 | setenv("WLC_DIM", "0", 0); |
130 | wlc_log_set_handler(wlc_log_handler); | 138 | wlc_log_set_handler(wlc_log_handler); |
131 | detect_nvidia(); | 139 | detect_nvidia(); |
@@ -138,14 +146,6 @@ int main(int argc, char **argv) { | |||
138 | } | 146 | } |
139 | register_extensions(); | 147 | register_extensions(); |
140 | 148 | ||
141 | if (debug) { | ||
142 | init_log(L_DEBUG); | ||
143 | } else if (verbose || validate) { | ||
144 | init_log(L_INFO); | ||
145 | } else { | ||
146 | init_log(L_ERROR); | ||
147 | } | ||
148 | |||
149 | #if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE | 149 | #if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE |
150 | sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); | 150 | sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); |
151 | #endif | 151 | #endif |