home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Theme / 8GadgetPack / 8GadgetPackSetup.msi / Gadgets.7z / Gadgets / HUD-Time.gadget / js / console_log.js < prev    next >
Text File  |  2012-11-01  |  440b  |  17 lines

  1. if(!window.console) {
  2.     //no console, create console.log and send it to system debug
  3.     window.console = { };
  4.  
  5.     console.log = function(msg) {
  6.         System.Debug.outputString('['+window.location+'] '+msg);
  7.     }
  8.  
  9.     console.log('console.log is now set up');
  10. } else {
  11.     console.log('[console.log.js] window already has a console object');
  12. }
  13.  
  14. window.onerror = function(msg, url, line) {
  15.     console.log('Error: '+msg+' @ '+line+' in '+url);
  16. }
  17.