Add config flag to log to console rather than Debug Logger extension, which for some reason is excruciatingly slow with multiple lines
With flag on, start up FF from command-line (e.g. /Applications/Firefox.app/Contents/MacOS/firefox) to use console
This commit is contained in:
parent
f9b4aab08d
commit
cf7cf17d7e
1 changed files with 9 additions and 6 deletions
|
@ -3,7 +3,8 @@ const SCHOLAR_CONFIG = {
|
|||
DB_FILE: 'scholar.sqlite',
|
||||
DB_VERSION: 2,
|
||||
DB_REBUILD: false, // erase DB and recreate from schema
|
||||
DEBUG_LOGGING: true
|
||||
DEBUG_LOGGING: true,
|
||||
DEBUG_TO_CONSOLE: false // dump debug messages to console rather than (much slower) Debug Logger
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -51,19 +52,21 @@ var Scholar = new function(){
|
|||
level = 3;
|
||||
}
|
||||
|
||||
try {
|
||||
var logManager =
|
||||
if (!SCHOLAR_CONFIG['DEBUG_TO_CONSOLE']){
|
||||
try {
|
||||
var logManager =
|
||||
Components.classes["@mozmonkey.com/debuglogger/manager;1"]
|
||||
.getService(Components.interfaces.nsIDebugLoggerManager);
|
||||
var logger = logManager.registerLogger("Firefox Scholar");
|
||||
var logger = logManager.registerLogger("Firefox Scholar");
|
||||
}
|
||||
catch (e){}
|
||||
}
|
||||
catch (e){}
|
||||
|
||||
if (logger){
|
||||
logger.log(level, message);
|
||||
}
|
||||
else {
|
||||
dump('scholar(' + level + '): ' + message);
|
||||
dump('scholar(' + level + '): ' + message + "\n\n");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue