var logger = require("morgan"); res.render = function(view, options, fn){ options = options || {}; var self = this; var req = this.req; var app = req.app; // support callback function as second arg if ('function' == typeof options) { fn = options, options = {}; } // merge res.locals options._locals = self.locals; // default callback to respond fn = fn || function(err, str){ if (err) return req.next(err); self.send(str); }; // Here I want to see what fn is // But it doesn't show me anything in console // How to use it? logger(fn); // render app.render(view, options, fn); };
查看这个链接:http://stackoverflow.com/questions/23494956/how-to-use-morgan-logger