Open lifehackett opened 8 years ago
I do not believe this is winston
related explicitly, but it might have something to do with gulp
or ES6 and winston
playing nice together. The following works fine on 2.x
:
var winston = require('./');
var props = require('./properties');
const logger = new winston.Logger({
transports: [
new winston.transports.Console({ timestamp: true }),
],
});
console.dir(Object.keys(logger.transports));
logger.transports.console.level = props.logLevel || 'info';
and outputs:
['console']
Thanks for your response. When you say 2.x
which lib are you referring to? Winston appears to be at 1.1.2
Also, I'm not clear on your example. Our usage of Winston logger works fine, it is only in the specific example I mentioned above where the error occurs. It very well maybe, as you said, a conflict between the 3 libraries. I tried switching to gulp-watch
and still get the error.
Going to try to summon @robrich from the gulp
side to try to help us triage this.
Much appreciated for the pro-activeness. I have also opened a ticket on the gulp-mocha
side https://github.com/sindresorhus/gulp-mocha/issues/113. I'll keep you posted on any progress on there end. Please let me know if I can assist in anyway.
We use Winston for logging in various parts of the application. In our
gulpfile.js
it gets imported in through some dependencies and is causing errors in other gulp tasks.My Mocha test runner is
gulp test
works finegulp watchTest
works the first time through, but after a change which triggers the watch I get an errorError in plugin 'gulp-mocha' Transport console not attached to this instance
When I remove any imports inside the
gulpfile.js
with a dependency on Winston logger, it works fine, but I'm not exactly sure how to resolve the issue.For completeness, here is our implementation on logger
Thank you for your time.