Closed adamvr closed 11 years ago
Also, there is a strange failure in the test suite that I couldn't figure out. I don't use vows so maybe you guys have a better idea of how to fix it. Thanks!
Sorry for the delay. Even though Travis-CI says your changes are passing, they are not (as evidenced by the build details). I've made some changes in master
so that Travis-CI works properly; please incorporate (rebase) these into your fork and resubmit a new (passing) pull request.
Also, please don't remove any test elements - we need those to confirm that changes are backwards-compatible rather only add new ones for new functionality.
PS: If you're just trying to pass Winston's existing transports into express-winston, you can do:
expressWinston.logger({
transports: winston.transports
})
Thanks!
For anyone searching around, I think
expressWinston.logger({
transports: winston.transports
})
should now be
var _ = require('underscore')
expressWinston.logger({
transports: _.values(winston.default.transports)
})
winston.transports
returns an object of constructors which winston-express doesn't accept. winston.default.transports
returns an object (key-value pairing) of the actual transports. We only want to pass the values.
@gdw2 Thank you, is this something we'd like to add to our Readme? if so, can you send a Pull Request?
Thank you.
The idea here is that I wanted to be able to do something like this:
...and have expressWinston use winston.log to log to the transports added using winston.add.
There was an additional change associated with this. I replaced the loop which logged to each of the transports with the creation of a winston logger (
var logger = new winston.Logger({transports: transports})
) and a single call tologger.log
. I think this is a little bit tidier.Thanks for the great module guys!