Minor cleanup, allow console.log(), .error(), etc. here

This commit is contained in:
Bryan Ashby 2016-07-25 10:47:30 -06:00
parent 623e96feb0
commit b0ddc3fec4
1 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,5 @@
/* jslint node: true */ /* jslint node: true */
/* eslint-disable no-console */
'use strict'; 'use strict';
//var SegfaultHandler = require('segfault-handler'); //var SegfaultHandler = require('segfault-handler');
@ -213,11 +214,10 @@ function startListening(cb) {
if(!conf.config.servers) { if(!conf.config.servers) {
// :TODO: Log error ... output to stderr as well. We can do it all with the logger // :TODO: Log error ... output to stderr as well. We can do it all with the logger
//logger.log.error('No servers configured'); //logger.log.error('No servers configured');
cb(new Error('No servers configured')); return cb(new Error('No servers configured'));
return;
} }
let moduleUtil = require('./module_util.js'); // late load so we get Config const moduleUtil = require('./module_util.js'); // late load so we get Config
moduleUtil.loadModulesForCategory('servers', (err, module) => { moduleUtil.loadModulesForCategory('servers', (err, module) => {
if(err) { if(err) {
@ -279,8 +279,8 @@ function startListening(cb) {
}); });
client.on('close', function onClientClose(hadError) { client.on('close', function onClientClose(hadError) {
var l = hadError ? logger.log.info : logger.log.debug; const logFunc = hadError ? logger.log.info : logger.log.debug;
l( { clientId : client.session.id }, 'Connection closed'); logFunc( { clientId : client.session.id }, 'Connection closed');
clientConns.removeClient(client); clientConns.removeClient(client);
}); });
@ -312,7 +312,7 @@ function startListening(cb) {
} }
function prepareClient(client, cb) { function prepareClient(client, cb) {
var theme = require('./theme.js'); const theme = require('./theme.js');
// :TODO: it feels like this should go somewhere else... and be a bit more elegant. // :TODO: it feels like this should go somewhere else... and be a bit more elegant.
@ -322,6 +322,6 @@ function prepareClient(client, cb) {
client.user.properties.theme_id = conf.config.preLoginTheme; client.user.properties.theme_id = conf.config.preLoginTheme;
} }
theme.setClientTheme(client, client.user.properties.theme_id); theme.setClientTheme(client, client.user.properties.theme_id);
cb(null); // note: currently useless to use cb here - but this may change...again... return cb(null); // note: currently useless to use cb here - but this may change...again...
} }