I have a function which is part of an object called server
, i.e server.log is a function which I use to log data. There are other properties of server which I do not want to pass to other functions, though I want server.log to be available to functions in other files.
function test() {
testingThis(server.log);
}
function testingThis(logf) {
logf("test123");
}
I get an error saying
Cannot read property 'emit' of undefined
I am using happy console module to log (server.log works fine in test function).