From 9ae360674ea78da14faab7910f23c0b3be7e4a7f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Jan 2013 03:49:38 -0500 Subject: [PATCH] added time output to log function --- lib/util.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/util.js b/lib/util.js index 591076fd..9a31b81f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -93,13 +93,17 @@ Util = exports || {}; * @param pArg */ Util.log = function(pArg){ - var lRet = pArg, - lConsole = Scope.console; + var lArg = pArg, + lConsole = Scope.console, + lDate = '[' + Util.getDate() + '] '; + + if(!Util.isString(lArg)) + lArg = JSON.stringify(lArg); if(lConsole && pArg) - lConsole.log(pArg); + lConsole.log(lDate + lArg); - return lRet; + return pArg; }; /**