flatiron/winston — pull request #449 by Nomon (2014-09-16 13:19:25+00:00)
Title: Logger.log meta parameter mutation issue

Without cloning it, configured rewriters will end up synchronously rewriting the original object passed in.
I do not think it is the intention for logging to mutate its parameters.

Steps to reproduce:
var winston = require('winston');
function addTime(level, msg, meta) {
meta.time = new Date();
return meta;
}

var logger = new winston.Logger({
level: 'info',
rewriters: [addTime],
transports: [new winston.transports.Console]
});
var message = 'logging with meta';
var response = {status:"ok"};
logger.info(message, response); // info: logging with meta status=ok, time=Tue Sep 16 2014 16:14:23 GMT+0300 (EEST)
console.log(response); // { status: 'ok', time: Tue Sep 16 2014 16:11:34 GMT+0300 (EEST) }