Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dates are silently ignored #527

Open
njlg opened this issue Jan 20, 2015 · 2 comments
Open

Dates are silently ignored #527

njlg opened this issue Jan 20, 2015 · 2 comments

Comments

@njlg
Copy link

njlg commented Jan 20, 2015

It seems like Issue #92 has come back.

var w = require('winston');
var d = new Date();

w.log('Found %s at %s', 'error', d);
// prints "Found error at %s"

console.log('Found %s at %s', 'error', d)
// prints "Found error at Tue Jan 20 2015 10:14:26 GMT-0800 (PST)"
@indexzero
Copy link
Member

This is definitely a bug, but you also need to specify a log level. You can also work around it for now by doing:

winston.log('info', 'Found %s at %s', 'error', (new Date() + ''));

or use a method on Date like d.toISOString().'

@indexzero
Copy link
Member

This turned out to be really tricky, but it will come in winston@2.0.0 later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants