Skip to content

Commit 04ee853

Browse files
committed
Add the logger earlier in the Aphlict startup process
Summary: Add the logger as soon as possible so that the log file will contain errors if the `ws` module cannot be loaded. Test Plan: Ran `./bin/aphlict debug` without having the `ws` module installed. Saw errors in the logs. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11457
1 parent f61846b commit 04ee853

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

support/aphlict/server/aphlict_server.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ process.on('uncaughtException', function(err) {
7070
set_exit_code(1);
7171
});
7272

73+
// Add the logfile so we'll fail if we can't write to it.
74+
if (config.log) {
75+
debug.addLog(config.log);
76+
}
77+
7378
try {
7479
require('ws');
7580
} catch (ex) {
@@ -96,11 +101,6 @@ if (ssl_config.enabled) {
96101
ssl_config.cert = fs.readFileSync(config['ssl-cert']);
97102
}
98103

99-
// Add the logfile so we'll fail if we can't write to it.
100-
if (config.log) {
101-
debug.addLog(config.log);
102-
}
103-
104104
// If we're just doing a configuration test, exit here before starting any
105105
// servers.
106106
if (config.test) {

0 commit comments

Comments
 (0)