* Code cleanup

* Placeholder concept of Bunyan child logger per connected client
This commit is contained in:
Bryan Ashby 2015-07-01 23:41:20 -06:00
parent 8e0dc505b1
commit fa7cf1f265
2 changed files with 9 additions and 53 deletions

View file

@ -153,7 +153,7 @@ function startListening() {
// Start tracking the client. We'll assign it an ID which is
// just the index in our connections array.
//
if(typeof client.runtime === 'undefined') {
if(_.isUndefined(client.runtime)) {
client.runtime = {};
}
@ -195,6 +195,11 @@ function startListening() {
function addNewClient(client) {
var id = client.runtime.id = clientConnections.push(client) - 1;
// Create a client specific logger
client.log = logger.log.child( { clientId : id } );
// :TODO: if client.log concept is kept, clean this up to use it:
var connInfo = {
connectionCount : clientConnections.length,
clientId : client.runtime.id,