mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
added time output to log function
This commit is contained in:
parent
69a22dbb33
commit
9ae360674e
1 changed files with 8 additions and 4 deletions
12
lib/util.js
12
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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue