I'm trying to get nano to log all requests while running tests, which are supposed to stub all nano calls. The logging looks like it should do that by providing DEBUG=nano/logger as an env var. Yet it doesn't actually log anything. After some searching I found that lib/logger.js exports a function that returns the logEvent function which then returns a log function. Unfortunately all the log() calls, like this one, end up calling the logEvent function, ignoring the resulting function, causing nothing to be logged.
I can't tell what the intention of that inner log() function is, that seems unnecessary and could be removed. Usually I'd send a PR, but considering #265 I'll hold off on that for now. Maybe an existing contributor (and CLA signee) can just apply the fix (or tell me what I'm doing wrong).
I'm trying to get
nano
to log all requests while running tests, which are supposed to stub all nano calls. The logging looks like it should do that by providingDEBUG=nano/logger
as an env var. Yet it doesn't actually log anything. After some searching I found thatlib/logger.js
exports a function that returns thelogEvent
function which then returns alog
function. Unfortunately all thelog()
calls, like this one, end up calling thelogEvent
function, ignoring the resulting function, causing nothing to be logged.I can't tell what the intention of that inner
log()
function is, that seems unnecessary and could be removed. Usually I'd send a PR, but considering #265 I'll hold off on that for now. Maybe an existing contributor (and CLA signee) can just apply the fix (or tell me what I'm doing wrong).