From 372f86a5046a486bdfaa403d67bfb8f101de6505 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Tue, 29 Sep 2015 09:20:07 +0200 Subject: [PATCH] Prepare for deploy test --- controllers/prototype/dbrequests.js | 2 +- lib/NodeLog.js | 10 ++++------ utils/load/load.js | 17 ++++++++++------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/controllers/prototype/dbrequests.js b/controllers/prototype/dbrequests.js index 50acdd1..eeb7032 100644 --- a/controllers/prototype/dbrequests.js +++ b/controllers/prototype/dbrequests.js @@ -801,7 +801,7 @@ DBReq.ExpCreator.prototype.finish = function() { // Commit, and then release this.client.query("COMMIT;", function() { - Log.debug('Exp creation took ' + (Date.now() - self.startTime) + ' ms'); + Log.debug('Exp creation took ' + (Date.now() - self.startTime) + ' ms', true); self.release(); self.client = null; diff --git a/lib/NodeLog.js b/lib/NodeLog.js index 6185e24..30d5b4f 100644 --- a/lib/NodeLog.js +++ b/lib/NodeLog.js @@ -73,15 +73,13 @@ Log.mailerror = function(error) { ); }; -if (isDev) { - Log.debug = function(info) { +Log.debug = function(info, force) { + if (isDev || force === true) { log( '[DBG] ' + (info !== undefined ? info : ''), Colors.ORANGE ); - }; -} else { - Log.debug = function(){}; -} + } +}; module.exports = Log; diff --git a/utils/load/load.js b/utils/load/load.js index 20ed514..511d882 100644 --- a/utils/load/load.js +++ b/utils/load/load.js @@ -1,3 +1,6 @@ +var baseUrl = 'http://localhost:4000/'; +var baseUrl = 'http://3dinterface.no-ip.org/'; + function makeId() { var text = ""; @@ -18,13 +21,13 @@ var casper = require('casper').create({ var limit = 100; -casper.start('http://localhost:4000/'); +casper.start(baseUrl); for (var i = 0; i < limit; i++) { (function(i) { - casper.thenOpen('http://localhost:4000/user-study', function() { + casper.thenOpen(baseUrl + 'user-study', function() { console.log(i); @@ -42,12 +45,12 @@ for (var i = 0; i < limit; i++) { // }, true); - this.thenOpen('http://localhost:4000/prototype/tutorial'); - this.thenOpen('http://localhost:4000/prototype/play'); - this.thenOpen('http://localhost:4000/prototype/play'); - this.thenOpen('http://localhost:4000/prototype/play'); + this.thenOpen(baseUrl + 'prototype/tutorial'); + this.thenOpen(baseUrl + 'prototype/play'); + this.thenOpen(baseUrl + 'prototype/play'); + this.thenOpen(baseUrl + 'prototype/play'); - this.thenOpen('http://localhost:4000/logout'); + this.thenOpen(baseUrl + 'logout'); });