mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-02 07:51:52 +02:00
* Code cleanup
* Placeholder concept of Bunyan child logger per connected client
This commit is contained in:
parent
8e0dc505b1
commit
fa7cf1f265
2 changed files with 9 additions and 53 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue