Changeset 189


Ignore:
Timestamp:
06/12/13 23:02:07 (6 years ago)
Author:
nhoyt
Message:

Updates for new getLogger syntax in utilities/loggins.js: previously calls had the form logger.log.debug; they are now simplified to log.debug. Also, the getLogger fn. is now passed the prefix string and enabled value when called to set the ainspector.log property in ainspector.onLoad.

Location:
trunk/proto-13/chrome/content
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/proto-13/chrome/content/ai-sidebar.js

    r182 r189  
    4040ainspectorSidebar.showTransition = function () { 
    4141  var location = ainspectorSidebar.progressListener.getLocation(); 
    42   ainspector.logger.log.debug("showTransition: " + location); 
     42  ainspector.log.debug("showTransition: " + location); 
    4343  ainspectorSidebar.clearCurrentView(); 
    4444  ainspectorSidebar.showProgressMeter(); 
     
    5858ainspectorSidebar.updateContext = function () { 
    5959  ainspectorSidebar.locationHref = window.content.location.href; 
    60   ainspector.logger.log.debug("updateContext: " + ainspectorSidebar.locationHref); 
     60  ainspector.log.debug("updateContext: " + ainspectorSidebar.locationHref); 
    6161  ainspectorSidebar.evaluate(); 
    6262  ainspectorSidebar.updateView(); 
     
    247247ainspectorSidebar.updateView = function () { 
    248248  if (parent.AINSPECTOR.currentView === null) return; 
    249   ainspector.logger.log.debug("updateView: " + ainspector.getViewName(parent.AINSPECTOR.currentView)); 
     249  ainspector.log.debug("updateView: " + ainspector.getViewName(parent.AINSPECTOR.currentView)); 
    250250 
    251251  ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AINSPECTOR.currentView); 
     
    278278 
    279279ainspectorSidebar.selectView = function (viewConst) { 
    280   ainspector.logger.log.debug("selectView: " + ainspector.getViewName(viewConst)); 
     280  ainspector.log.debug("selectView: " + ainspector.getViewName(viewConst)); 
    281281 
    282282  if (parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS && 
     
    315315  if (parent.AINSPECTOR.currentView !== ainspector.viewConst.DETAILS) return; 
    316316 
    317   ainspector.logger.log.debug("selectPreviousView: " + ainspector.getViewName(parent.AINSPECTOR.previousView)); 
     317  ainspector.log.debug("selectPreviousView: " + ainspector.getViewName(parent.AINSPECTOR.previousView)); 
    318318 
    319319  // update currentView 
  • trunk/proto-13/chrome/content/datasource.js

    r169 r189  
    9191 
    9292  if (debug) { 
    93     ainspector.logger.log.debug("url: " + url); 
    94     ainspector.logger.log.debug("doc title: " + doc.title); 
    95     ainspector.logger.log.debug("rulesetId: " + rulesetId); 
    96     ainspector.logger.log.debug("ruleLevels: " + ruleLevels); 
    97     ainspector.logger.log.debug("recommendedRules: " + recommendedRules); 
    98     ainspector.logger.log.debug("brokenLinks: " + brokenLinks); 
    99     ainspector.logger.log.debug("layoutTables: " + layoutTables); 
     93    ainspector.log.debug("url: " + url); 
     94    ainspector.log.debug("doc title: " + doc.title); 
     95    ainspector.log.debug("rulesetId: " + rulesetId); 
     96    ainspector.log.debug("ruleLevels: " + ruleLevels); 
     97    ainspector.log.debug("recommendedRules: " + recommendedRules); 
     98    ainspector.log.debug("brokenLinks: " + brokenLinks); 
     99    ainspector.log.debug("layoutTables: " + layoutTables); 
    100100  } 
    101101}; 
  • trunk/proto-13/chrome/content/ff-overlay.js

    r187 r189  
    88Components.utils.import("chrome://ai-sidebar/content/ai-common.js"); 
    99 
    10 // import logger and LOG_LEVEL 
    11 Components.utils.import("chrome://ai-sidebar/content/utilities/logging.js", ainspector); 
    12  
    1310// create namespace for utilities imports 
    1411ainspector.utils = {}; 
     12 
     13// import getLogger 
     14Components.utils.import("chrome://ai-sidebar/content/utilities/logging.js", ainspector.utils); 
    1515 
    1616// import Enum and inherits 
     
    127127    parent.AINSPECTOR.startup = false; 
    128128    var elapsed = Date.now() - parent.AINSPECTOR.startTime; 
    129     ainspector.logger.log.info("Elapsed time at startup: " + elapsed); 
     129    ainspector.log.info("Elapsed time at startup: " + elapsed); 
    130130    toggleSidebar('ainspector-view-sidebar'); 
    131131  } 
     
    142142ainspector.onLoad = function () { 
    143143  // change logger enabled and level properties here (and only here) 
    144   ainspector.logger.enabled = false; 
    145   ainspector.logger.level = ainspector.LOG_LEVEL.DEBUG; 
    146   ainspector.logger.prefix = "AIS-"; 
    147   ainspector.logger.log.info("Loading AInspector Sidebar extension..."); 
     144  ainspector.log = ainspector.utils.getLogger("AIS", false); 
     145  ainspector.log.level = ainspector.log.LEVEL.DEBUG; 
     146  ainspector.log.info("Loading AInspector Sidebar extension..."); 
    148147 
    149148  // initializations 
     
    161160 
    162161  /* check namespace setup 
    163   ainspector.logger.log.debug(ainspector.utils.getProperties(ainspector, "ainspector")); 
    164   ainspector.logger.log.debug(ainspector.utils.getMethods(ainspector, "ainspector")); 
     162  ainspector.log.debug(ainspector.utils.getProperties(ainspector, "ainspector")); 
     163  ainspector.log.debug(ainspector.utils.getMethods(ainspector, "ainspector")); 
    165164  */ 
    166165}; 
Note: See TracChangeset for help on using the changeset viewer.