commit 25ad3181f5850d9e27befc9cd829ad25baefcd0b
parent 4c1fad95b930edf9f7ac2083ea554f0b5b3a7ca5
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 29 Nov 2015 09:08:56 -0500
Merge pull request #276 from sce/earlier_logging
main: Setup logging before wlc_init.
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sway/main.c b/sway/main.c
@@ -126,6 +126,14 @@ 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);
+ }
setenv("WLC_DIM", "0", 0);
wlc_log_set_handler(wlc_log_handler);
detect_nvidia();
@@ -138,14 +146,6 @@ int main(int argc, char **argv) {
}
register_extensions();
- if (debug) {
- init_log(L_DEBUG);
- } else if (verbose || validate) {
- init_log(L_INFO);
- } else {
- init_log(L_ERROR);
- }
-
#if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE
sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH);
#endif