Closed riteshsangwan closed 7 years ago
Hum yea we probably need to pass the listener as part of the options themselves.
@neumino in addition to a simple function(message)
callback, I think it would make sense to allow the user to pass a logger
instance that conforms to the standard log levels defined by libraries like bunyan
and winston
. That is, an object with the methods { error, warn, info, verbose, debug }
.
logger
instance, we use that object directly.logger
instance, we create a mock that defines each of the log methods as the user's callback.logger
is specified (the default), we create a mock that defines each of the log methods using the console
API (error => error, warn => warn, info|verbose|debug => log
).This would address the concerns brought up in https://github.com/neumino/rethinkdbdash/issues/325 whilst still leaving any additional logging dependencies up to the user.
@marshall007 +1
Fixed in 2.3.29 - You can pass a function to the log
option when initializing the driver.
I looked into delaying the initialization of events, but that seems to be a non trivial change.
I have this code
The issue is
Whenever a new instance of
R
is created there is this log frompool.js
file.When this log is invoked there are no listeners yet attached to newly created instance and hence the log event will not be received by the application for this message.