LearnBoost/socket.io — pull request #1016 by gshankar (2012-09-05 04:09:48+00:00)
Title: Timestamps in Log

Hey there,

I've added a configurable option to the logger to allow for human-readable timestamps to be output to the socket.io log.

It's really helped us when debugging problems with our app so I thought it was something that others could use as well.

I've defaulted timestamps to be off initially unless you set 'log timestamps' to be true.

I was going to write a test for this but couldn't think of one that wasn't brittle, i.e. I wanted to look for indexOf the current Year in the data of the console output but even that *could* break at the end of the year. Probably a stupid thing to worry about though so if you want me to add a test or have an idea on how I can test for it better please let me know.

Cheers,
Ganesh