Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Shet yer Shtatus

Jason Sebring sebringj

💭
Shet yer Shtatus
View GitHub Profile
@spmason
spmason / logging.js
Created Jan 24, 2012
A simple node module that makes console.log/error/warn/debug statements log through winston (simply include at the beginning of your app)
View logging.js
'use strict';
var util = require('util'),
winston = require('winston'),
logger = new winston.Logger(),
production = (process.env.NODE_ENV || '').toLowerCase() === 'production';
module.exports = {
middleware: function(req, res, next){
console.info(req.method, req.url, res.statusCode);