Skip to content

Commit

Permalink
Fix debug error on production env
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiandouce committed May 3, 2015
1 parent 7e29e2e commit ae5c9d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/setup/index.js
Expand Up @@ -2,6 +2,7 @@
* Module dependencies. * Module dependencies.
*/ */


var debug = require('debug')('njs:setup');
var express = require('express'); var express = require('express');
var passport = require('passport'); var passport = require('passport');
var session = require('express-session'); var session = require('express-session');
Expand Down Expand Up @@ -48,7 +49,7 @@ module.exports = function configuration (app) {
if (config('env') == 'testing') { if (config('env') == 'testing') {


// Log config settigs load // Log config settigs load
log( 'testing settings' ); debug( 'testing settings' );


} }


Expand All @@ -60,7 +61,7 @@ module.exports = function configuration (app) {
if (config('env') == 'production') { if (config('env') == 'production') {


// Log config settigs load // Log config settigs load
log( 'production settings' ); debug( 'production settings' );


/** /**
* Set `nowww` middleware helper * Set `nowww` middleware helper
Expand Down Expand Up @@ -151,7 +152,7 @@ module.exports = function configuration (app) {


app.use(function(err, req, res, next) { app.use(function(err, req, res, next) {
// log // log
console.log('Some odd error: %j', err); debug('Some odd error: %j', err);
// now let it go // now let it go
next(); next();
}); });
Expand Down Expand Up @@ -188,4 +189,4 @@ function merge (a, b){
} }
} }
return a; return a;
}; };

0 comments on commit ae5c9d5

Please sign in to comment.