1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 07:50:57 +01:00

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
This commit is contained in:
Joshua Spence 2015-01-22 07:45:55 +11:00
parent f61846b469
commit 04ee853cec

View file

@ -70,6 +70,11 @@ process.on('uncaughtException', function(err) {
set_exit_code(1);
});
// Add the logfile so we'll fail if we can't write to it.
if (config.log) {
debug.addLog(config.log);
}
try {
require('ws');
} catch (ex) {
@ -96,11 +101,6 @@ if (ssl_config.enabled) {
ssl_config.cert = fs.readFileSync(config['ssl-cert']);
}
// Add the logfile so we'll fail if we can't write to it.
if (config.log) {
debug.addLog(config.log);
}
// If we're just doing a configuration test, exit here before starting any
// servers.
if (config.test) {